Search this blog

Saturday, October 10, 2009

Basic Functions Of System Databases - SQL


What are the basic functions of master, msdb, tempdb databases?

Microsoft SQL Server has four system databases: 


Master - The master database records all of the system level information for a SQL Server system. It records all login accounts and all system configuration settings. Master is the database that records the existence of all other databases, including the location of the database files. 


Tempdb - tempdb holds all temporary tables and temporary stored procedures. It also fills any other temporary storage needs such as work tables generated by SQL Server. Tempdb is re-created every time SQL Server is started so the system starts with a clean copy of the database. 


By default, tempdb auto grows as needed while SQL Server is running. If the size defined for tempdb is small, part of your system processing load may be taken up with auto growing tempdb to the size needed to support your workload each time to restart SQL Server. You can avoid this overhead by using ALTER DATABASE to increase the size of tempdb.


Model - The model database is used as the template for all databases created on a system. When a CREATE DATABASE statement is issued, the first part of the database is created by copying in the contents of the model database, and then the remainder of the new database is filled with empty pages. Because tempdb is created every time SQL Server is started, the model database must always exist on a SQL Server system. 


Msdb - The msdb database is used by SQL Server Agent for scheduling alerts and jobs, and recording operators.

No comments:

Post a Comment