SQL Server Master Recovery

Source: Internet
Author: User
Tags microsoft sql server mssql mssqlserver backup

----Fault 1:master has backup

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 SQL Server 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

376 pages have been processed for database ' master ', file ' master ' (located on file 1).

3 pages have been processed for database ' master ', file ' Mastlog ' (located on file 1).

The master database has been successfully restored. Shutting down SQL Server.

SQL Server is terminating this process.

5.start the SQL Server in normal

C:\Documents and Settings\administrator>net start MSSQLSERVER

SQL Server (MSSQLSERVER) service is starting ...

SQL Server (MSSQLSERVER) service has started successfully.

---fault 2:master just the database file name or the road is not right

1. Stop MSSQLServer service

net stop MSSQLServer

2. Modify Master's MDF name

CD C:\Program Files\Microsoft SQL Server\mssql.1\mssql\data

ren master.mdf master01.mdf

3.net start MSSQLServer

4. View Error file

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 (the system cannot find the specified file.) ) occurred while opening file ' C:\Program Files\Microsoft SQL Server\mssql.1\mssql\data\master.mdf ' to obtain Configurati On information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.

5. Modify the filename according to errorlog prompts

ren master01.mdf master.mdf

6. Start

NET start MSSQLServer

---failure 3:master not backed up

Start/wait d:\setup.exe/qn instancename=mssqlserver reinstall=sql_engine rebuilddatabase=1 Sapwd=sa Sqlbrowserpassword=chinese_prc_bin

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.