Professional Documents
Culture Documents
database files and one or more transaction log files. As a database administrator
(DBA), it is your duty to design and create databases to store user data and other
objects. As part of your role as a database creator, you must decide how large to
make these database files and what type of growth characteristics they should have,
as well as their physical placement on your system.
In this article, you will get to know where to create a database and then put the data
and log files.
First, you must decide where to put the data and log files.
Guidelines to Use
1.
Data and log files should be on separate physical drives so that, in case of a
disaster, you have a better chance of recovering all data.
2. Transaction logs are best placed on a RAID-1 array because this has the
fastest sequential write speed.
3. Data files are best placed on a RAID-5 array because they have faster read
speed than other RAID-arrays.
4. If you have access to a RAID-10 array, you can place data and log files on it
because it has all the advantages of RAID-1 and RAID-5.
Next, you must decide how big your files should be. Data files are broken down into
8KB pages and 64KB extents (eight contiguous pages). To figure out how big your
database will need to be, you must figure out how big your tables will be.
a. To do this, add the storage requirements for each datatype in the table.
c. Calculate the space required for variable length columns using this formula:
variable_datasize = 2 + (num_variable_columns X 2) + max_varchar_size.
• Calculate the number of rows that will fit on one page. Each page is 8,192
bytes with a header, so each page holds 8,096 bytes of data. Therefore,
calculate the number of rows using this formula: 8096 ÷ (RowSize + 2).
• Estimate the number of rows the table will hold. No formula exists to calculate
this; you just need to have a good understanding of your data and user
community.
• Calculate the total number of pages that will be required to hold these rows.
Use this formula: Total Number of Pages = Number of Rows in Table /
Number of Rows Per Page.
Once you have decided where to put your files and how big they should be, follow
these steps to create a database named Sales (you will be creating the files on a
single drive for simplicity)
You should see a database named Sales in SQL Server Management Studio.