![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Can someone help me to optimise this create db? CREATE DATABASE EVSTORE ON PRIMARY ( NAME=evstore_data, FILENAME='E:\Program Files\Microsoft SQL Server\MSSQL\Data \db1.mdf', SIZE = 10 MB, MAXSIZE = UNLIMITED, FILEGROWTH = 20000 KB ) LOG ON ( NAME=evstore_log, FILENAME='E:\Program Files\Microsoft SQL Server\MSSQL\Data \db1.ldf', SIZE = 10 MB, MAXSIZE = UNLIMITED, FILEGROWTH = 20000 KB ) I googled this to put the database on the E: drive which is a SAN. This db will grow and have lots if rows increasing every day, so I want to avoid bad practice, and have fast queries event when it has got big after a year. |
#4
| |||
| |||
|
|
syd_p (sydneypue... (AT) yahoo (DOT) com) writes: Can someone help me to optimise this create db? * * *CREATE DATABASE EVSTORE ON PRIMARY * * *( * * * *NAME=evstore_data, * * * *FILENAME='E:\Program Files\Microsoft SQL Server\MSSQL\Data \db1.mdf', * * * SIZE = 10 MB, MAXSIZE = UNLIMITED, FILEGROWTH = 20000KB * * * *) * * *LOG ON * * * *( * * * *NAME=evstore_log, * * * *FILENAME='E:\Program Files\Microsoft SQL Server\MSSQL\Data \db1.ldf', * * *SIZE = 10 MB, MAXSIZE = UNLIMITED, FILEGROWTH = 20000 KB * * * *) I *googled this to *put the database on the E: drive which is a SAN.. This db will grow and have lots if rows increasing every day, so I want to avoid bad practice, and have fast queries event when it has got big after a year. To achieve that, you will need to get more things right than just the CREATE DATABASE statement. But at least it's a start. But 10 MB is not a good start, if you execpted it to grow. If you exepct it to be 10 GB in a year, create it as 10 GB now. As Tom said, you need some capacity planning. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Links for SQL Server Books Online: SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx |
#5
| |||
| |||
|
|
Can someone help me to optimise this create db? CREATE DATABASE EVSTORE ON PRIMARY ( NAME=evstore_data, FILENAME='E:\Program Files\Microsoft SQL Server\MSSQL\Data \db1.mdf', SIZE = 10 GB, MAXSIZE = UNLIMITED, FILEGROWTH = 20000 KB ) LOG ON ( NAME=evstore_log, FILENAME='E:\Program Files\Microsoft SQL Server\MSSQL\Data \db1.ldf', SIZE = 10 GB, MAXSIZE = UNLIMITED, FILEGROWTH = 20000 KB ) Good point - I reckon it might be 10 GB in a 6 months/year How does it look now? |
#6
| |||
| |||
|
|
You have also put both data and log on the same disk. This is certainly not a good idea at all, but they should be on different disks, and on different LUNs in the SAN. Then again, I know nothing what you will use this database for, and without any information about the context all advices could very well be misguided. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Links for SQL Server Books Online: SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx |
#7
| |||
| |||
|
|
I was wondering how big the log file might get - I have made it the same size as db file. |
![]() |
| Thread Tools | |
| Display Modes | |
| |