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

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

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

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

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

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

clipboard

   

详细的步骤可以参考

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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值