0% found this document useful (0 votes)
17 views12 pages

171 Ch05 02 SystemDatabases

Uploaded by

juju0190
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views12 pages

171 Ch05 02 SystemDatabases

Uploaded by

juju0190
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

1

Chapter 05: Video 02

The System
Databases in SQL
Server 2012

Chapter: Creating and Managing Databases


Course: SQL Server 2012 Database Administration
Course ID: 171
Instructor: Scott Whigham

1 p. 1
2

SQL Server 2012 uses SQL Server


2012 for most configurations
– Some configuration is in the registry
– And some configuration is done via XML
files

2 p. 2
3

Most instance and service


configurations are stored in the five
system databases
– master
– model
– msdb
– tempdb
– Resource
– Let’s talk about each!

3 p. 3
4

The master database stores:


– ... instance‐level configuration
– ... information about each database
– ... the logins into the server
– ... server‐level permissions
– Is the first database “loaded” by SQL Server
service on start

4 p. 4
5

The model database:


– Is a template for new databases
– When a new database is created:
• Database properties and objects are copied from
model to the new database
– Useful for ensuring that new databases
contain specific objects

5 p. 5
6

The msdb database:


– Stores any and all automation configuration
and information
• Log shipping, mirroring, jobs, alerts, mail
– Stores history about backups, jobs
– May optionally store SSIS packages
– Used heavily by SQL Server Agent

6 p. 6
7

The tempdb database:


– Is what the name implies: temporary storage
• Temp tables are created here
• Storage of intermediate result sets used during
query processing
– Row versioning is done here
– Is “wiped clean” at shutdown and created at
startup

7 p. 7
8

Before we talk about the Resource


database, we need a little more
background...
– A database in SQL Server 2012 is primarily a
self‐contained unit
• The data file contains *almost* everything necessary
• Makes it easy to move a database to a new server
– More on this later!

8 p. 8
9

There is a downside to this “shared


nothing” model:
– All databases have certain utility needs
• Reporting functions, configuration stored procs, etc
– Creating these “once per database” leads to
overhead
• During an update, SQL Server would have to update
each database
• What if a database is added to the server after an
update?

9 p. 9
10

The Resource database is the answer:


– A database that contains all of the “system
objects” in SQL Server
• Objects in the sys. schema are from Resource
– Makes it easy to upgrade
• During upgrade, MSFT can just replace the resource
database and immediately all databases on server have
latest source code and objects
– Hidden from view; must view at the disk level

10 p. 10
11

We do not (typically) change the


data in a system database directly
– We execute stored procedures or TSQL code
that makes those changes for us
• sys.sp_configure
• ALTER SERVER CONFIGURATION

11 p. 11
12

In the next video…


– The Types of Databases in a Typical SQL
Server 2012 Instance

“Common sense is not so common.”


- Voltaire

12 p. 12

You might also like