📄 10939.htm
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MS SQL基础教程:备份和恢复系统数据库 - 编程入门网</title>
<meta name="keywords" content="MS SQL基础教程:备份和恢复系统数据库">
<meta name="description" content="MS SQL基础教程:备份和恢复系统数据库">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="/images/style.css" rel="stylesheet" type="text/css" />
<script src="/js1/head.js"></script>
</head>
<body leftmargin="0" topmargin="0" bgcolor="#efefef" oncopy=nocopy()>
<TABLE width="760" cellPadding="0" cellSpacing="0" bgcolor="#eff7fe" align="center">
<TR>
<TD><a href="/index.htm"><img src="/images/logo1.gif" width="150" height="60" border="0"></a></TD>
<TD width="470" align="right"><script src="/js1/top.js"></script></TD>
<TD width="125" align="center"><script src="/js1/topsy.js"></script></TD>
</TR>
</TABLE>
<table width="760" border="0" cellpadding="1" cellspacing="0" class="bklan" align="center">
<tr>
<td align="center" bgcolor="#eff7fe" height="24"> | <a href='/Programming/index.htm'>编程语言</a> | <a href='/webkf/index.htm'>web开发</a> | <a href='/data/index.htm'>数据库</a> | <a href='/Network/index.htm'>网络技术</a> | <a href='/OS/index.htm'>操作系统</a> | <a href='/Servers/index.htm'>服务器</a> | <a href='/web/index.htm'>网页设计</a> | <a href='/Design/index.htm'>图形设计</a> | <a href='/Office/index.htm'>办公软件</a> | <a href='/soft/index.htm'>常用软件</a> | <a href='/shadu/index.htm'>杀毒频道</a> | <a href='/PC/index.htm'>学电脑</a> |</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="760" align="center" bgcolor="#ffffff" border="0">
<tr>
<td align="center"><script src="/js1/content1.js"></script></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="25" background="/templets/img/31bg3.gif" align="left" class="guidet"> → 当前位置:<a href='http://www.bianceng.cn/'>首页</a>→<a href='/data/index.htm'>数据库</a>→<a href='/data/SQLServer/index.htm'>SQL Server</a>→<a href='/data/SQLServer/jc/index.htm'>SQL Server教程</a>→正文</td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td valign="top" class="guidet" width="595"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="ct">
<tr>
<td align="center" valign="middle" class="til"><h3> MS SQL基础教程:备份和恢复系统数据库 </h3>
发布时间:2008-07-11 来源:本站收集整理 作者:不详<br />
<script src="/js1/468.js"></script>
</td>
</tr>
<tr>
<td style="font-size:14px" align="left" class="til"><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><script src="/js1/300.js"></script></td>
</tr>
</table><p> 系统数据库保存了有关SQL Server 的许多重要数据信息,这些数据的丢失将给系统带来极为严重的后果,所以我们也必须对系统数据库进行备份。这样一旦系统或数据库失败,则可以通过恢复来重建系统数据库。在SQL Server 中重要的系统数据库主要有master、 msdb、 distribution、 model。 虽然tempdb 也是系统数据库但没有必要对其进行备份,因为SQL Server 每次启动都会重新创建该数据库,而当SQL Server 停止运行时,tempdb 数据库中所有数据都会被自动清除。在本节我们主要讨论master 数据库的备份和恢复问题。</p>
<p> 备份master 数据库与备份用户数据库一样,只要数据库状态发生变化我们就要通过备份来保存这些变化以防止一旦系统失。败而导致数据丢失以下情况的发生往往要求我们立即对master 数据库进行备份。</p>
<p> 增加或删除用户数据库。但是如果增加或删除文件或文件组,或用户数据库自动增加来容纳新添加的数据,这些操作并不对master 数据库产生影响,所以此时不必对其进行备份;</p>
<p> 创建新的登录或执行与登录有关的操作,但是增加数据库用户并不影响master 数据库;</p>
<p> 创建或删除备份设备;</p>
<p> 为了进行分布式查询或远程过程调用而对数据库服务器进行配置,如增加连接服务器或远程登录等。</p>
<p> 对master 数据库,我们常进行完全数据库备份。而恢复master 数据库,却有两种途径:或是使用master 数据库当前备份,或是执行Rebuild Master Utility 来重建master 数据库。如果master 数据库遭到的损坏还不足以使SQL Server 无法启动,我们可以使用master 数据库的当前备份来执行恢复;如果master 遭到严重破坏,SQL Server 无法启动,或者master 数据库的当前备份也不能使用,我们则必须执行Rebuild Master Utility 来重建master 数据库(此时master 数据库中的所有以前的数据都将丢失),然后再使用备份来进行恢复(如果master 的备份可以使用)。</p>
<p> 使用Rebuild Master Utility 来重建master 主要执行以下步骤:</p>
<p> (1) 关掉SQL Server, 然后运行位于 Microsoft SQL Server80 oolsBinn 下的Rebuildem.exe 文件,出现Rebuild Master 对话框。如图15-17 所示。</p>
<p> <img alt="" src="/upimg/080501/1807390.gif" /></p>
<p> (2)单击Browse 按钮来浏览包括Data 文件的源目录。</p>
<p> (3)单击Setting 按钮出现Collation Setting 对话框,如图15-18 所示。</p>
<p> (4)单击Rebuild 按钮重建Master 数据库。</p>
<p> <img alt="" src="/upimg/080501/1807391.gif" /></p>
<p> 重建master 数据库只是整个恢复工作的开始,然后要装入master 数据库的备份。如果备份不可用,则要重新创建任何必要的备份设备,接着恢复msdb model distribution 数据库以及用户数据库。对于那些在master 数据库最近的备份后所创建的数据库来说,如果其存在备份,则使用备份进行恢复,如果不存在,只能通过重新连接数据库文件(数据和日志文件)来重新恢复数据库。</p>
<p> 在SQL Server 中,我们可以拆开数据库的数据文件和事务日志文件,然后将它们重新连接到另外的服务器或同一个服务器。拆开数据库就是将数据库从SQL Server 中删除,但是保持数据和事务日志文件的完整性。然后事务日志和数据文件可在任何运行 SQL Server 的服务器上被重新连接成该数据库。因此当您准备把数据库从一台机器移到另外的机器上但不重新创建数据库,或者将数据库移到另外的磁盘上您会发现数据库的拆分和连接是很有用处的。</p>
<p> <img alt="" src="/upimg/080501/1807392.gif" /></p>
<p> 本章小结</p>
<p> 本章主要讨论数据库备份和恢复的相关问题。重点应了解各种不同数据库备份方法的异同点,学会根据不同实际情况制定相应的备份和恢复策略。了解备份设备的创建方法以及如何使用SQL Server Enterprise Manager 和BACKUP、 RESTORE 命令备份或恢复数据库。</p>
<p> <a href="/data/SQLServer/jc/200712/6352.htm">查看全套"MS SQL基础教程"</a></p><center><br /><script src="/js1/4682.js"></script></center>
<p>上一篇:<a href='/OS/FreeBSD/200806/10938.htm'>FreeBSD其他安装问题</a> 下一篇:<a href='/data/SQLServer/jc/200807/10940.htm'>MS SQL基础教程:SQL数据库的恢复</a> </p></td>
</tr>
<tr>
<td align="left" style="font-size:14px;" height="25"><IMG src="/images/t0.gif" width="12" height="12" align=absMiddle><strong>相关文章</strong><br /><table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10940.htm">MS SQL基础教程:SQL数据库的恢复</a><br/>
</td>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10941.htm">MS SQL基础教程:备份向导</a><br/>
</td>
</tr>
<tr>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10942.htm">MS SQL基础教程:SQL数据库备份</a><br/>
</td>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10943.htm">MS SQL基础教程:创建备份设备</a><br/>
</td>
</tr>
<tr>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10944.htm">MS SQL基础教程:备份和恢复概述</a><br/>
</td>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10945.htm">MS SQL基础教程:SQL Server安全性管理的途</a><br/>
</td>
</tr>
<tr>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10950.htm">MS SQL基础教程:用户和安全性管理--SQL Ser</a><br/>
</td>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10971.htm">MS SQL基础教程:系统存储过程</a><br/>
</td>
</tr>
<tr>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10972.htm">MS SQL基础教程:管理存储过程</a><br/>
</td>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10973.htm">MS SQL基础教程:创建存储过程</a><br/>
</td>
</tr>
<tr>
<td width='50%'>
·<a href="/data/SQLServer/jc/200807/10974.htm">MS SQL基础教程:存储过程概述</a><br/>
</td>
<td width='50%'>
·<a href="/data/SQLServer/jc/200805/9928.htm">教你如何来进行编写通用的数据访问</a><br/>
</td>
</tr>
<tr>
<td width='50%'>
·<a href="/data/SQLServer/jc/200805/9927.htm">教你如何使用SQL Server来过滤数据</a><br/>
</td>
<td width='50%'>
·<a href="/data/SQLServer/jc/200805/9926.htm">SQL Server数据库的数据汇总完全解析</a><br/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="165" valign="top" class="guideb"><script src="/js1/1601.js"></script><table width="100%" border="0" cellpadding="0" cellspacing="0" valign="top">
<tr>
<td height="25" align="center" background="/templets/img/31bg3.gif"><strong>阅读排行</strong></td>
</tr>
<tr>
<td>·<a href="/data/SQLServer/jc/200712/6352.htm">MS SQL Server入门教程</a><br/>
·<a href="/data/SQLServer/jc/200807/10974.htm">MS SQL基础教程:存储过程</a><br/>
·<a href="/data/SQLServer/jc/200705/1189.htm">sql语言教程</a><br/>
·<a href="/data/SQLServer/jc/200807/10973.htm">MS SQL基础教程:创建存储</a><br/>
·<a href="/data/SQLServer/jc/200705/1182.htm">sql字符串函数</a><br/>
·<a href="/data/SQLServer/jc/200712/6301.htm">MS SQL基础教程:SQL Serve</a><br/>
·<a href="/data/SQLServer/jc/200712/6302.htm">MS SQL基础教程:SQL Serve</a><br/>
·<a href="/data/SQLServer/jc/200712/6314.htm">MS SQL基础教程:数据类型</a><br/>
·<a href="/data/SQLServer/jc/200705/1188.htm">Sql语言基础</a><br/>
·<a href="/data/SQLServer/jc/200712/6311.htm">MS SQL基础教程:Transact-</a><br/>
·<a href="/data/SQLServer/jc/200712/6312.htm">MS SQL基础教程:SQL变量</a><br/>
·<a href="/data/SQLServer/jc/200705/1184.htm">sql基本语句</a><br/>
·<a href="/data/SQLServer/jc/200807/10972.htm">MS SQL基础教程:管理存储</a><br/>
·<a href="/data/SQLServer/jc/200712/6306.htm">MS SQL基础教程:数据库基</a><br/>
·<a href="/data/SQLServer/jc/200705/1178.htm">sql数据表</a><br/>
</td>
</tr>
<tr>
<td><script src="/js1/1602.js"></script></td>
</tr>
<tr>
<td height="25" align="center" background="/templets/img/31bg3.gif"><strong>最新文章</strong></td>
</tr>
<tr>
<td><script src="/plus/js/0.js" language="javascript"></script></td>
</tr>
</table></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="760" align="center" bgcolor="#ffffff" border="0">
<tr>
<td align="center"><script src="/js1/content2.js"></script></td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr height="26">
<td bgcolor="#e1f0fd" width="48"></td>
<td bgcolor="#6ab3f4" width="35"></td>
<td bgcolor="#0a518f" colspan="2" width="4"></td>
<td bgcolor="#c0c0c0" width="530" align="center"><a title="将本站设为你的首页" onclick="this.style.behavior='url(#default#homepage)';this.sethomepage('http://www.bianceng.cn');return false;" href="http://www.bianceng.cn/">设为首页</a> | <a class="navmenu"
title="将本站加入到你的收藏夹"
href="javascript:window.external.AddFavorite(location.href,document.title)">加入收藏</a> | <a href="/about/about.htm">关于本站</a> | <a href="/plus/flink.php">友情链接</a> | <a href="/about/banquan.htm">版权声明</a> | <a href="/plus/sitemap.html">网站地图</a> | <a href="/plus/rssmap.html">RSS订阅</a></td>
<td bgcolor="#0a518f" colspan="2" width="4"></td>
<td bgcolor="#6ab3f4" width="32"></td>
<td bgcolor="#e1f0fd" width="47"></td>
</tr>
<tr height="26">
<td colspan="9" bgcolor="#FFFFFF" align="center">编程入门网 版权所有,bianceng.cn,All Rights Reserved. <script src="/js/tongji.js"></script> 阅读次数:<script src="/plus/count.php?aid=10939&mid=0" language="javascript"></script></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -