码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-07-08 09:56:58      阅读:319      评论:0      收藏:0      [点我收藏+]

标签:sql server 2012   数据库   系统数据库恢复   

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

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

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

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

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

bubuko.com,布布扣

   

详细的步骤可以参考

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:理解系统数据库恢复,布布扣,bubuko.com

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

标签:sql server 2012   数据库   系统数据库恢复   

原文地址:http://543925535.blog.51cto.com/639838/1434962

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!