SQL Server 2012笔记分享-51:理解系统数据库恢复

下图是一个很重要的表格,详细描述了系统数据库的备份需求,支持的恢复模式和还原的选项。

master数据库:需要备份,需要在单用户模式下恢复

model数据库:需要备份,恢复数据库的方式为T3608 trace flag

msdb数据库:需要备份,恢复模式默认为简单,恢复数据库的方式和恢复普通数据库一样,没有特殊要求

tempdb数据库:不需要备份,因为在实例启动的时候tempdb会重建;

   

详细的步骤可以参考

http://msdn.microsoft.com/zh-cn/library/dd207003.aspx

===============================================================

下面是关于各个系统数据库的作用特点介绍

Recovering System Databases

master

The master database holds all system level configurations. SQL Server cannot start up normally without the Master database. Restoring/Rebuilding the master database take a set of special procedures which will be discussed in upcoming slides.

model

The model database is used as the template for all databases that are created on the instance of SQL Server. If the model database is corrupt or missing, the instance of SQL Server cannot start. Therefore a restore cannot be issued unless special steps are first taken. In case of a corrupt model database the instance must be started with the -T3608 trace flag. T3608 is used to only startup the master database. Then the model database can be restored using a normal restore statement.

MSDB

The MSDB database is used by SQL Server Agent for scheduling alerts and jobs, and for recording operators. MSDB also contains history tables such as the backup and restore history tables. In case of a corrupt msdb, SQL Agent will not be working. From a restore perspective, MSDB is just like any other user database and can be restored as such.

Resource db

The Resource Database is a read-only database that contains copies of all system objects that ship with Microsoft SQL Server 2012. No backup can be done for this database, as it is hidden. In case of an corruption of the database it can be restored using a file restore or through running the setup of SQL Server.

Tempdb

Tempdb is a workspace for holding temporary or intermediate result sets. This database is re-created every time an instance of SQL Server is started. When the server instance is shut down, any data in tempdb is deleted permanently. A backup cannot be done and is unnecessary on tempdb as it is recreated with every restart of the instance. A restart of the instance is can recover tempdb in most corruption cases.

Reference:

Considerations for Backing Up and Restoring System Databases:

http://go.microsoft.com/fwlink/?LinkID=233398

==============================================================

本文出自 “曾垂鑫的技术专栏” 博客,谢绝转载!

SQL Server 2012笔记分享-51:理解系统数据库恢复,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。