Manage and Configure Databases Flashcards
What is Auto_Close?
When all users disconnect from a database, then the database releases all of the resources for itself. Bad if you have connections come and go often. Good with a small database that is only accessed by a few users.
What is Auto_Shrink?
Disk space does not shrink when you remove a lot of files. Better to start with as big as you think you need and give it as much space as you are able.
How can you make sure that all databases start with the same options?
Go to the MODEL database and set up the options how you want. New databases will have those same options.
What file extension does the Primary Data File have?
.mdf
What file extension does the Transaction Log File have?
.ldf
What file extension do the Secondary Data Files have?
.ndf
What is the benefit to having multiple data files?
Your database can be searching two different drives at the same time and can increase performance.
What is required in order to move a table to a different file group?
A clustered index.
What is the t-sql syntax to move the storage to a different file group?
CREATE CLUSTERED INDEX [INDEXNAME] ON [TABLENAME] (
COLUMN1
)
ON [FILEGROUP]
How do you initially create a table on a different file group?
CREATE TABLE [tablename] ( col1 ) ON [FileGroup]
What is partitioning?
It is the ability to divide out a table and send data to different file groups.
What are the four steps to create a partition?
Create Filegroups/files
Create partition function
Create partition scheme
Create/Modify table using partition scheme
What is a partition function?
This is the filter for your data.
What is the t-sql needed to create a Partition?
CREATE PARTITION FUNCTION NAME as RANGE [Right, Left] FOR VALUES (N’VALUE1’, N’VALUE2’)
CREATE PARTITION SCHEME [SCHEMENAME] AS PARTITION [NAME] TO ([FILEGROUP1],[FILEGROUP2],[FILEGROUP3])
CREATE CLUSTERED INDEX [INDEXNAME] ON [TABLENAME] ( COL1 ) ON [NAME] ([COL1])
DROP INDEX [INDEXNAME] ON [TABLENAME]
How can you see which partition data is going into?
SELECT $PARTITION.PARTITIONNAME(VALUE) AS PARTITIONNUMBER