----故障1:master有備份
1.backup database for master
backup database master to disk='e:\master.bkf' with format
go
2.stop mssqlserver service
net stop mssqlserver
3.start sqlserver with single user mode
C:\>cd C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr -c -f -m
4.restore master database from backup files
C:\Documents and Settings\Administrator>sqlcmd
1> restore database master from disk='e:\master.bkf'
2> go
已為資料庫 'master',檔案 'master' (位於檔案 1 上)處理了 376 頁。
已為資料庫 'master',檔案 'mastlog' (位於檔案 1 上)處理了 3 頁。
已成功地還原了 master 資料庫。正在關閉 SQL Server。
SQL Server 正在終止此進程。
5.start the sqlserver in normal
C:\Documents and Settings\Administrator>net start mssqlserver
SQL Server (MSSQLSERVER) 服務正在啟動 ..
SQL Server (MSSQLSERVER) 服務已經啟動成功。
---故障2:master只是資料庫檔案名或路勁不對
1.停止mssqlserver服務
net stop mssqlserver
2.修改master的mdf名字
cd C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
ren master.mdf master01.mdf
3.net start mssqlserver
4.查看error檔案
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG:
2010-02-08 12:02:00.88 Server Error: 17113, Severity: 16, State: 1.
2010-02-08 12:02:00.88 Server Error 2(系統找不到指定的檔案。) occurred while opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.
5.按照errorlog提示修改檔案名稱
ren master01.mdf master.mdf
6.啟動
net start mssqlserver
---故障3:master沒有備份
start /wait d:\setup.exe /qn instancename=mssqlserver reinstall=sql_engine rebuilddatabase=1 sapwd=sa sqlbrowserpassword=chinese_prc_bin
查看本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/