Sql Server master and other four databases

Microsoft SQLServer has four system databases:

1.master database The master database records all system-level information of the SQL Server system. It records all login accounts and system configuration settings. The master database is a database that records all other databases, including the location of database files. The master database records the initialization information of SQL Server, and it always has an available latest master database backup.

2.tempdb database

The tempdb database stores all temporary tables and temporary stored procedures. It also meets any other temporary storage requirements, such as storing SQL Server-generated worktables. The tempdb database is a global resource in which temporary tables and stored procedures for all users connected to the system are stored. The tempdb database is recreated every time SQL Server starts, so the database is always clean when the system starts. Temporary tables and stored procedures are automatically dropped when the connection is lost, and there will be no connections active when the system is shut down, so nothing in the tempdb database will be saved from one session of SQL Server to another. By default, the tempdb database automatically grows as needed while SQL Server is running. However, unlike other databases, the database engine is reset to its initial size each time it is started. If the size defined for the tempdb database is smaller, automatically increasing the size of the tempdb database to the size required to support the workload may become part of the system processing load each time SQL Server is restarted. To avoid this overhead, you can use ALTER DATABASE to increase the size of the tempdb database.

3.model database

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

4. msdb database The msdb database is used by the SQL Server Agent when scheduling alerts and jobs and logging operators.

Guess you like

Origin blog.csdn.net/qq_43886548/article/details/126888187