Course 10361 Incomplete!!! Flashcards

(52 cards)

1
Q

Who creates and manages databases?

A

Both database administrators and developers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How are databases moved from the development environment to the production environment?

A

Organizations create SQL Server 2008 R2 databases in a development environment and then generate a script that will be passed on to a database administrator to run on a production computer running SQL Server 2008 R2. Understanding the different methods of creating a database by using Transact-SQL and SQL Server Management Studio is important. This course will explore the planning issues that are involved prior to creating the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When is the best time to optimize performance of a database?

A

Although there are many ways to improve the performance of SQL Server 2008 R2, the database creation stage is the best opportunity to implement the logical and physical design for optimal performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What types of databases are created when you install SQL Server 2008 R2?

A

The first type is a system database, which is created automatically. Each system database performs different functions and stores information about SQL Server 2008 R2 or one of its specific components. System databases also store metadata related to SQL Server 2008 R2.
The second type is the user-defined database. These databases are created manually by a database developer. User-defined databases typically hold business data that can be queried and modified.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the types of databases?

A
master
msdb
model
tempdb
distribution
Mssqlsystemresource
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the name of the type of database that is the template for all new user-defined databases?

A

model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the name of the database that stores temporary objects?

A

tempdb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What type of database stores information about the jobs, alerts and operators that are defined in the SQL Server Agent?

A

msdb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What kind of database is created when replication is enabled and configured?

A

distribution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the name of the hidden, read-only system database? What is another name for it?

A

Mssqlsystemresource, aka Resource database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which database to SQL Server is like Windows registry is to Windows?

A

master

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Where do features such as SQL Server Integration Services, Service Broker, and DAtabase mail store metadata?

A

msdb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Where is information about all the databases in an instance of SQL Server 2008 stored?

A

master. This data is known as metadata.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is used as the basis of a new user-defined database and how is it produced?

A

A copy of the model database is used as the template for the new database. It is then renamed as the database name defined in the CREATE DATABASE statement. Metadata about the new database is stored in the master database before the new database is created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Who is tempdb available to?

A

All users connected to SQL Server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the distribution database store?

A

Metadata and history data for all types of replication and transaction for transactional replication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What contains all system objects that are included n SQL Server 2008?

A

Mssqlsystemresource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What happens if the master database becomes corrupt and what is a recommended safety measure?

A

If the master database becomes corrupted, it prevents SQL Server 2008 from running. It is recommended that a backup of the master database be taken every time a new database is added or removed from the instance of SQL Server 2008.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

When are temporary objects removed from tempdb?

A

When a connection that creates a temporary object disconnects or if the server restarts. If the tempdb database becomes corrupt, it is recreated with SQL Server restarts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the SQL Server Agent responsible for?

A

Scheduled automation of jobs and the firing of alerts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What two files are created when you create a user-defined database?

22
Q

What does the MDF store and how many can you have?

A

MDF is the primary data file that stores the data. You can define only one MDF.

23
Q

What does the LDF store?

A

The LDF file is the transaction log file that stores a record of the transactions that have been issued against the SQL Server.

24
Q

Where is it recommended you put the MDF and LDF files?

A

As a minimum requirement, it is recommended that the LDF file is stored on a faster, separate disk than the MDF file.
Ideally, each disk is on a separate controller. This improves data throughput and disk I/O for information that is read and written to the database.

25
How does the database verify user permission?
While the primary data file, the MDF file, is used to store data, it must be considered that on its own that MDF stores both user data and database metadata in the same file. Consider that in accessing data in a table, SQL Server 2008 must read the database metadata such as the sys.syspermissions view to verify if the connection is granted and the user has permission to read the data in a table before the data is read.
26
Where can you store user data separate from the MDF?
You can consider introducing secondary data files, known as NDF files, to store the user data in a file separate from the database metadata that is stored in the MDF file.
27
Where are NDF files and how many can you have?
NDF files can be defined on a separate disk. Also, you are not limited to the number of NDF files that you can define. This provides the potential to spread the data across different NDF files to take advantage of the disk configuration of the physical server to improve the access to the data.
28
If the ability to recover data to a point in time is important how should you configure the database?
If the ability to recover data to a point in time is important, it is recommended that you store the LDF file on a RAID 1 volume. This provides resilience if a disk fails. This also provides the ability to back up the log file if one of the disks fails and the other remains operational. Storing MDF and NDF files on a single disk can represent a single point of failure. By utilizing RAID 5 volumes, the data files benefit from improved read and write performance as the data is spread across multiple disks. There is also a resilience if a disk in the RAID 5 array goes down.
29
How should you configure the database if high performance is critical and recoverability is not?
However, if the data requirements of your business specify high performance is critical and recoverability is not, using RAID 1 volumes is a useful solution as long as it is understood that data can only be recovered from a backup once a disk goes down.
30
Can you change the structure that SQL Server uses to store data?
No.
31
What is the smallest unit that SQL Server uses to store data? What is its maximum size?
At its smallest unit, SQL Server 2008 R2 stores data on a page. A page has a maximum size of 8192 bytes.
32
How are rows stored and what are the limitations?
A page has a maximum size of 8192 bytes of which 8060 bytes (8 KB) is reserved for storing data in a row within a page. A row that is defined in a table cannot span a page. Hence, the maximum size of a row is 8060 bytes.
33
How can you optimize how rows are stored?
You can fit many rows in a single page (assuming they are much smaller than the limitation of 8060 bytes (8KB). Therefore, it is important to minimize the amount of space that is defined in the row of a table. If more rows are fitted in the page, then more data is stored and lesser I/O is required to retrieve a large amount of data—thus improving the speed at which data is retrieved.
34
What form does SQL Server retrieve data and what is the size?
SQL Server 2008 retrieves data in the form of extents. Eight pages are grouped together to form an extent, which is 64 KB in size.
35
What are the different types of extents and how are they defined?
If all the pages in an extent contain data that belong to the same SQL Server 2008 object, such as data in a single table, the extent is known as a uniform extent. If an extent contains data of different objects, then it is known as a mixed extent.
36
What are file groups used for?
You can use filegroups to distribute the table data across multiple disks and facilitate backup at a filegroup level.
37
What is the default for filegroups when a database is created?
By default, when a database is created, the primary data file maps to a filegroup named Primary.
38
What do filegroups store and not store?
A filegroup stores one or more data files in it. Transaction log files cannot be associated with a filegroup.
39
What is VLDB?
very large databases
40
What is the benefit of filegroups for VLDB?
From an administrative perspective, databases can be backed up at a filegroup level, reducing the backup times of very large databases (VLDB).
41
What other reasons would you create User-defined filegroups?
data allocation and placement. From a data allocation and placement perspective, filegroups are used to define the location of the table or index data. This provides the ability to spread the table or index data across multiple disks to improve performance.
42
What do you call a special filegroup that contains file system directories instead of files?
A FILESTREAM filegroup.
43
What is the benefit of FILESTREAM data?
FILESTREAM data enables the storage of large binary data objects within a SQL Server database within the Microsoft Windows NT file system. This provides the benefit of storing large binary objects that are greater than 2GB in size. In order to use FILESTREAM, the FILESTREAM data must be stored in FILESTREAM filegroups.
44
What are the file system directories in a FILESTREAM called and what do they do?
These file system directories are called data containers. Data containers are the interface between the Database Engine storage and the file system storage.
45
How can you limit modification of a file group?
Any existing filegroup, except the primary filegroup, can be marked as read-only. A filegroup marked read-only cannot be modified in any way. Read-only filegroups can also be compressed.
46
What is BLOB?
A Binary Large OBject (BLOB) is a collection of binary data ((example: word documents, image files, music and videos etc) stored as a single entity in a database management system. Blobs are typically images, audio or other multimedia objects, though sometimes binary executable code is stored as a blob. (per Wikipedia)
47
When was FILESTREAM introduced?
SQL Server 2008. It is initially disabled at installation by default but can be enabled then or later. Note: filegroups were available previously. This is FILESTREAM only.
48
What are the three levels of access to FILESTREAM?
1. Enable FILESTREAM for Transact-SQL access 2. Enable FILESTREAM for file I/O streaming access 3. Allow remote clients to have streaming access to FILESTREAM data https: //www.simple-talk.com/sql/learn-sql-server/an-introduction-to-sql-server-filestream/
49
If a file group is spread across Data1.ndf on disk 1 with 50 GB and Data2.ndf on disk 2 with 100 GB, how will SQL store 60 mb of data?
SQL Server uses a proportional fill strategy across all disks that are part of the same filegroup. It will place 20mb on Data1.ndf/disk 1 and 40mb on Data2.ndf/Disk 2. This ensures that each disk fills up proportionally.
50
How can file groups help if the time taken to perform a full or differential backup is too prohibitive?
You can create an effective backup strategy by using filegroup backups. For example, a database consists of three filegroups—PRIMARY, DYNAMIC, and STATIC. A backup of the PRIMARY filegroup takes place every Monday, while the STATIC filegroup is backed up every Wednesday, and the DYNAMIC filegroup is backed up every Friday. This backup is conducted on a weekly basis. This is useful for very large databases or databases that have a very small maintenance window.
51
How can filegroups be used to improve performance of read and write operations against the table?
Filegroups can be used to horizontally partition the data of a single table into different data files. To create a table partitioning strategy, perform the following steps. 1. Create a partition function 2. Create a partition scheme 3. Map the partition scheme within a CREATE TABLE statement.
52
Collation is an option when creating your database. What is collation?
Collation is a set of rules for comparing strings (or characters in a character set). It seems obvious that A is before B. But you can have variants like case-insensitive (A and a are equal and both before B and b), accent-insensitive or more specific collations like Spanish in which words starting with Ch come after all other words starting with C. For example: In latin9, there are letters as e é è ê f, if sorted by their binary representation, it will go e f é ê è but if the collation a different collation could put them in the order you thought they would be, which is all of e é è ê are equal, and then f.