好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁(yè) > 知識(shí)庫(kù) > sqlserver2005 master與msdb數(shù)據(jù)庫(kù)備份恢復(fù)過(guò)程

sqlserver2005 master與msdb數(shù)據(jù)庫(kù)備份恢復(fù)過(guò)程

熱門(mén)標(biāo)簽:電銷(xiāo)機(jī)器人虛擬號(hào)碼 浙江地圖標(biāo)注 九鹿林外呼系統(tǒng)怎么收費(fèi) 沈陽(yáng)智能外呼系統(tǒng)代理 滄州營(yíng)銷(xiāo)外呼系統(tǒng)軟件 創(chuàng)業(yè)電銷(xiāo)機(jī)器人 舞鋼市地圖標(biāo)注app 海南自動(dòng)外呼系統(tǒng)價(jià)格 松原導(dǎo)航地圖標(biāo)注

由于系統(tǒng)數(shù)據(jù)庫(kù)對(duì)Sql Server來(lái)說(shuō)尤其重要,為了確保SQL SERVER系統(tǒng)的正常運(yùn)行,除了日常備份用戶(hù)的數(shù)據(jù)庫(kù)之外,我們還需要備份系統(tǒng)數(shù)據(jù)庫(kù),如對(duì)Master,Model,Msdb(TempDB不需備份)進(jìn)行完整備份

1、還原Master數(shù)據(jù)庫(kù)

如果系統(tǒng)配置丟失或Master出現(xiàn)問(wèn)題,可以進(jìn)入單用戶(hù)模式進(jìn)行還原;如果出現(xiàn)下列情況,必須重新生成損壞的 master 數(shù)據(jù)庫(kù):
A. master 數(shù)據(jù)庫(kù)的當(dāng)前備份不可用。
B. 存在 master 數(shù)據(jù)庫(kù)備份,但由于 Microsoft SQL Server 實(shí)例無(wú)法啟動(dòng),因此無(wú)法還原該備份。
1、重新生成 master 數(shù)據(jù)庫(kù):

注意:

在 SQL Server 2005 中已廢止 Rebuildm.exe 程序。若要重新生成 master 數(shù)據(jù)庫(kù),請(qǐng)使用 setup.exe。

1、 Start /wait setup.exe /qn INSTANCENAME=InstanceName> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=NewStrongPassword>

例:start /wait e:“setup.exe /qn INSTANCENAME=mssqlserver REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=abc123@!@
注:INSTANCENAME:指定實(shí)例名,默認(rèn)實(shí)例則用mssqlserver表示
REINSTALL:指定引擎
SAPWD:強(qiáng)密碼
Setup.exe:指定光盤(pán)1中的根目錄下的文件
/qn 開(kāi)關(guān)用于取消所有安裝程序?qū)υ?huà)框和錯(cuò)誤消息。如果指定 /qn 開(kāi)關(guān),則所有安裝程序消息(包括錯(cuò)誤消息)都將寫(xiě)入安裝程序日志文件。有關(guān)日志文件的詳細(xì)信息,請(qǐng)參閱如何查看 SQL Server 2005 安裝日志文件。
指定 /qb 開(kāi)關(guān)將顯示基本的安裝程序?qū)υ?huà)框。還會(huì)顯示錯(cuò)誤消息。

2、 還原Master備份(在恢復(fù)master的備份時(shí)要注意:必須在單用戶(hù)(single   user)模式下進(jìn)行  )      a.進(jìn)入單用戶(hù)模式的方法:    

'1.在命令行模式下輸入sqlservr   -c   -f   -m或者輸入sqlservr   -m'
'其中:-c   可以縮短啟動(dòng)時(shí)間,SQL   Server   不作為Windows   NT的服務(wù)啟動(dòng)'
'  -f   用最小配置啟動(dòng)SQL   Server'
'-m   單用戶(hù)模式啟動(dòng)SQL   Server'

2.系統(tǒng)默認(rèn)沒(méi)有設(shè)置PATH,先進(jìn)入CMD,進(jìn)入“C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“Binn”,執(zhí)行SQLSERVR.EXE –M

打開(kāi)SSMS工具,先斷開(kāi)連接,再新建查詢(xún),執(zhí)行以下命名還原
USE master
GO
RESTORE DATABASE master
FROM disk=‘c:“master.bak‘
GO
開(kāi)始實(shí)驗(yàn)了~~~
MASTER重新生成
為了模擬MASTER數(shù)據(jù)庫(kù)壞了,我們就刪除MASTER數(shù)據(jù)庫(kù)(要停止SQL SERVER服務(wù)才能刪除)在我的電腦,C:“ PROGRAM FILES“MICROSOFT SQL SERVER“MSSQL.1“MSSQL“DATE 中刪除MASTER.MDF
重新生成MASTER
1.首先在CMD中輸入
start /wait setup.exe /qn INSTANCENAME=InstanceName> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=NewStrongPassword>
其中的 SETUP.EXE為啟動(dòng)光盤(pán)的路徑,我這里的是 E:“SETUP.EXE /QN
我這里的為默認(rèn)實(shí)例所以其中的INSTANCENAME>用 MSSQLSERVER代替
最后的NewStrongPassword>為密碼我設(shè)密碼為abc123@!@,所以就用abc123@!@代替NewStrongPassword>
若沒(méi)有返回錯(cuò)誤,我們就可以到我的電腦中C:“ PROGRAM FILES“MICROSOFT SQL SERVER“MSSQL.1“DATE上面又有MASTER.MDF了
接下來(lái)進(jìn)入目錄
單用戶(hù)模式
啟動(dòng)SSMS工具,新建查詢(xún)
輸入命令
啟動(dòng)服務(wù)(MSSQL SERVER)
打開(kāi)SSMS
連接到數(shù)據(jù)庫(kù)后就可以發(fā)現(xiàn)數(shù)據(jù)庫(kù)中的數(shù)據(jù)又回來(lái)了
以下是我在命令行下搞的命令,我用記事本的方式全部復(fù)制下來(lái)了,為了不傳附件,我就直接粘貼到下面了

復(fù)制代碼 代碼如下:

Microsoft Windows [版本 5.2.3790]
(C) 版權(quán)所有 1985-2003 Microsoft Corp.
C:“Documents and Settings“Administrator>start /wait e:“setup.exe /qn INSTANCENAME=mssqlserver REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=abc123@!@
C:“Documents and Settings“Administrator>cd C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“Binn
C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“Binn>sqlservr.exe -m
2008-04-18 15:47:46.56 Server Authentication mode is MIXED.
2008-04-18 15:47:46.59 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
2008-04-18 15:47:46.59 Server (c) 2005 Microsoft Corporation.
2008-04-18 15:47:46.59 Server All rights reserved.
2008-04-18 15:47:46.59 Server Server process ID is 3984.
2008-04-18 15:47:46.59 Server Logging SQL Server messages in file ‘C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“LOG“ERRORLOG‘.
2008-04-18 15:47:46.59 Server This instance of SQL Server last reported using a process ID of 764 at 2008-4-18 15:46:40 (local) 2008-4-18 7:46:40 (UTC). This is an informational message only; no user action is required.
2008-04-18 15:47:46.60 Server Registry startup parameters:
2008-04-18 15:47:46.60 Server -d C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“DATA“master.mdf
2008-04-18 15:47:46.60 Server -e C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“LOG“ERRORLOG
2008-04-18 15:47:46.60 Server -l C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“DATA“mastlog.ldf
2008-04-18 15:47:46.62 Server Command Line Startup Parameters:
2008-04-18 15:47:46.62 Server -m2008-04-18 15:47:46.64 服務(wù)器 SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2008-04-18 15:47:46.67 服務(wù)器 Detected 1 CPUs. This is an informational message; no user action is required.
2008-04-18 15:47:46.78 服務(wù)器 Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2008-04-18 15:47:46.84 服務(wù)器 Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.
2008-04-18 15:47:47.95 服務(wù)器 Attempting to recover in-doubt distributed transactions involving Microsoft Distributed Transaction oordinator (MS DTC).
This is an informational message only. No user action is required.
2008-04-18 15:47:47.96 服務(wù)器 Database Mirroring Transport is disabled in the endpoint configuration.
2008-04-18 15:47:47.96 spid5s Warning ******************
2008-04-18 15:47:47.96 spid5s SQL Server started in single-user mode. This an informational message only. No user action is required.
2008-04-18 15:47:47.99 spid5s Starting up database ‘master‘.
2008-04-18 15:47:48.17 spid5s Recovery is writing a checkpoint in database ‘master‘ (1). This is an informational message only. No user action is required.
2008-04-18 15:47:48.28 spid5s SQL Trace ID 1 was started by login "sa".
2008-04-18 15:47:48.32 spid5s Starting up database ssqlsystemresource‘.
2008-04-18 15:47:48.76 spid5s Server name is ‘VM01‘. This is an informational message only. No user action is required.
2008-04-18 15:47:48.78 spid8s Starting up database ‘model‘.
2008-04-18 15:47:49.20 服務(wù)器 A self-generated certificate was successfully loaded for encryption.
2008-04-18 15:47:49.23 服務(wù)器 Server is listening on [ ‘a(chǎn)ny‘ ipv4> 1433].
2008-04-18 15:47:49.24 服務(wù)器 Server local connection provider is ready to accept connection on [ ““.“pipe“SQLLocal“MSSQLSERVER ].
2008-04-18 15:47:49.24 服務(wù)器 Server local connection provider is ready to accept connection on [ ““.“pipe“sql“query ].
2008-04-18 15:47:49.28 服務(wù)器 Server is listening on [ 127.0.0.1 ipv4>1434].
2008-04-18 15:47:49.28 服務(wù)器 Dedicated admin connection support was established for listening locally on port 1434.
2008-04-18 15:47:49.29 服務(wù)器 The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2008-04-18 15:47:49.31 服務(wù)器 SQL Server is now ready for client connections. This is an informational message; no user action is required.
2008-04-18 15:47:49.40 spid5s Starting up database ‘msdb‘.
2008-04-18 15:47:49.68 spid8s Clearing tempdb database.
2008-04-18 15:47:49.93 spid5s Recovery of any in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC) has completed. This is an informational message only. No user action is required.
2008-04-18 15:47:50.57 spid8s Starting up database ‘tempdb‘.
2008-04-18 15:47:50.76 spid5s Recovery is complete. This is an informational message only. No user action is required.
2008-04-18 15:56:22.34 spid51 SQL Trace was stopped due to server shutdown. Trace ID = ‘1‘. This is an informational message only; no user action is required.
2008-04-18 15:56:22.40 服務(wù)器 The SQL Network Interface library could not deregister the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Administrator should deregister this SPN manually to avoid client authentication errors.
C:“Program Files“Microsoft SQL Server“MSSQL.1“MSSQL“Binn>

打開(kāi)SSMS工具,先斷開(kāi)連接,再新建查詢(xún),執(zhí)行以下命名還原

復(fù)制代碼 代碼如下:

USE master
GO
RESTORE DATABASE master
FROM disk=‘C:“Program Files“Microsoft SQL Server“MSSQL.1 “MSSQL“Backup“master.bak‘
GO

數(shù)據(jù)庫(kù)中的顯示的消息應(yīng)為:

已為數(shù)據(jù)庫(kù) ‘master‘,文件 ‘master‘ (位于文件 1 上)處理了 376 頁(yè)。
已為數(shù)據(jù)庫(kù) ‘master‘,文件 ‘mastlog‘ (位于文件 1 上)處理了 6 頁(yè)。
已成功地還原了 master 數(shù)據(jù)庫(kù)。正在關(guān)閉 SQL Server。
SQL Server 正在終止此進(jìn)程。
則表示master數(shù)據(jù)庫(kù)還原成功,啟動(dòng)服務(wù)后進(jìn)入SSMS即可看到master數(shù)據(jù)庫(kù)了

恢復(fù)master數(shù)據(jù)庫(kù)

方法一:(操作步驟)

1停止MSSQLSERVER服務(wù)
2命令行輸入:

復(fù)制代碼 代碼如下:

net start "SQL Server (MSSQLSERVER)" /m

正常情況下顯示如下信息:

復(fù)制代碼 代碼如下:

SQL Server (MSSQLSERVER) 服務(wù)正在啟動(dòng) ..
SQL Server (MSSQLSERVER) 服務(wù)已經(jīng)啟動(dòng)成功。

3命令行輸入:

復(fù)制代碼 代碼如下:

sqlcmd
1>USE master;
2>GO

此時(shí)顯示:
已將數(shù)據(jù)庫(kù)上下文更改為 'master'。

復(fù)制代碼 代碼如下:

1>RESTORE DATABASE master FROM DISK='數(shù)據(jù)庫(kù)備份文件路徑';
2>GO

如果恢復(fù)成功,顯示如下信息:

已為數(shù)據(jù)庫(kù) 'master',文件 'master' (位于文件 1 上)處理了 376 頁(yè)。
已為數(shù)據(jù)庫(kù) 'master',文件 'mastlog' (位于文件 1 上)處理了 3 頁(yè)。
已成功地還原了 master 數(shù)據(jù)庫(kù)。正在關(guān)閉 SQL Server。
SQL Server 正在終止此進(jìn)程。
[/code]

失敗則顯示:

復(fù)制代碼 代碼如下:

消息 3154,級(jí)別 16,狀態(tài) 4,服務(wù)器 HC,第 1 行
備份集中的數(shù)據(jù)庫(kù)備份與現(xiàn)有的 'master' 數(shù)據(jù)庫(kù)不同。
消息 3013,級(jí)別 16,狀態(tài) 1,服務(wù)器 HC,第 1 行
RESTORE DATABASE 正在異常終止。

此時(shí)需[/code]要在恢復(fù)語(yǔ)句后面加上:WITH REPLACE。如:

1>RESTORE DATABASE master FROM DISK=數(shù)據(jù)庫(kù)備份文件路徑' WITH REPLACE;
2>GO
[/code]

4重啟MSSQLSERVER服務(wù)

方法二:(與方法一差不多)

1打開(kāi)“SQL Server 配置管理器”,單擊“SQL Server 服務(wù)”
2在右窗格中,右鍵單擊“SQL Server (實(shí)例名>)”,再單擊“屬性”
3在“高級(jí)”選項(xiàng)卡的“啟動(dòng)參數(shù)”框中,鍵入以分號(hào)“;”分隔的參數(shù)。(例如,若要以單用戶(hù)模式啟動(dòng),在現(xiàn)有啟動(dòng)選項(xiàng)之前插入“-m;”,單擊“確定”,此時(shí),彈出警告框,單擊“確定”即可)
4重新啟動(dòng)數(shù)據(jù)庫(kù)引擎
5(同方法一中步驟3)
6成功恢復(fù)master數(shù)據(jù)庫(kù)后,若要以正常的多用戶(hù)模式重新啟動(dòng)服務(wù)器實(shí)例,必須先從“啟動(dòng)參數(shù)”框中刪除剛才輸入的“-m;”,然后重新啟動(dòng)SQL Server服務(wù)

恢復(fù)msdb數(shù)據(jù)庫(kù)

在msdb數(shù)據(jù)庫(kù)里存儲(chǔ)較多的是SQL Agent里的內(nèi)容,如作業(yè)、調(diào)度、操作員、警告等信息,同時(shí)還存放SQL Server Integration Service(SSIS)相關(guān)信息。其恢復(fù)過(guò)程與普通數(shù)據(jù)庫(kù)恢復(fù)過(guò)程大同小異,不同點(diǎn)就是需要在單用戶(hù)模式啟動(dòng)下進(jìn)行恢復(fù)。

1打開(kāi)SQL Server Management Studio,連接到相關(guān)的數(shù)據(jù)庫(kù)服務(wù)器
2右鍵單擊msdb數(shù)據(jù)庫(kù),單擊“屬性”打開(kāi)數(shù)據(jù)庫(kù)屬性窗口,單擊“選項(xiàng)”,在右邊的“狀態(tài)”/“限制訪問(wèn)”指定“SINGLE_USER”,然后單擊“確定”即以單用戶(hù)模式啟動(dòng),此時(shí)msdb顯示為“msdb(單個(gè)用戶(hù))”
3(同恢復(fù)普通數(shù)據(jù)庫(kù)一樣...)
4恢復(fù)完畢后,別忘了將“限制訪問(wèn)”改加以前的狀態(tài)“MULTI_USER”

您可能感興趣的文章:
  • SqlServer備份數(shù)據(jù)庫(kù)的4種方式介紹
  • sqlserver備份還原數(shù)據(jù)庫(kù)功能封裝分享
  • SQLServer 2005 自動(dòng)備份數(shù)據(jù)庫(kù)的方法分享(附圖解教程)
  • Sqlserver2000 數(shù)據(jù)庫(kù)備份實(shí)例代碼
  • asp 在線備份與恢復(fù)sqlserver數(shù)據(jù)庫(kù)的代碼
  • sqlserver 自動(dòng)備份所有數(shù)據(jù)庫(kù)的SQL
  • sqlserver 數(shù)據(jù)庫(kù)日志備份和恢復(fù)步驟
  • SqlServer批量備份多個(gè)數(shù)據(jù)庫(kù)且刪除3天前的備份

標(biāo)簽:公主嶺 日喀則 西藏 臺(tái)灣 商洛 寶雞 咸寧 海口

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《sqlserver2005 master與msdb數(shù)據(jù)庫(kù)備份恢復(fù)過(guò)程》,本文關(guān)鍵詞  sqlserver2005,master,與,msdb,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《sqlserver2005 master與msdb數(shù)據(jù)庫(kù)備份恢復(fù)過(guò)程》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于sqlserver2005 master與msdb數(shù)據(jù)庫(kù)備份恢復(fù)過(guò)程的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 99热99操99射| 农村同性壮汉野外互交H| 美女被喷白浆视频| 少扫一极免费一级A片| 国产91??白丝在一线播放| 国产精品66页| ??我~慢爽好大~视频男女做| 黄色长篇小说| 久久久国产精品VA蜜月臀部81| 男人尻女人| 十大禁用软件app黄台大全下载| 久久精品亚洲AV无码一区二区三区 | 老师扒开让我?我爽了一夜| 第69章 亲了亲他 于他心上做妖精 | 久久久久久综合对白国产| 色悠久久久| 一级淫片bbbxxx| 一男一女一级一片免费播放| 北岛玲美痴女播放| 健身房被教练玩小茹| 野草在线观看视频精品| 双乳都露出来被揉| 法国女人性猛交| 吃奶摸下激烈视频无遮挡| 荫蒂添到高潮免费视频| 久久久久久久网| 精品视频福利| 两座乳峰又白又大图片高清| 三上悠亚精品一区二区久久| 亚洲欧美成人久久一区| 房东老头摸的我很舒服| 香港三级吃孕妇奶水| 女大学生叫床| 霸道校草求我回头小说| 交换的一天酷客伦理| 男人扯开奶罩揉吮乳房一会就硬了| 91视频app视频下载ios| 日韩免费无码婬片AA片西瓜影院| 午夜福利1000集合集92| 欧美一级婬片A片免费看网站毒液| 92看片婬黄大片欧美看国产片|