SQL Server-master database Corruption resolution summary

Source: Internet
Author: User
Tags sql server books

After the SQL Server primary database is damaged, the SQL Server service fails to start, viewing the error log, and you see the following error message:

' master '.
2015-10-27 10:15:23.01 spid6s Error: 9003, severity: 20, State: 1.
inch ' master ' if  in a failure during startup.
2015-10-27 10:15:23.01 spid6s cannot recover the master database. SQL Server is unable to run. Restore Master from a full backup, repair it, or rebuild it. For more information on how to rebuild the master database, see SQL Server Books Online.

If the database version is in the Chinese version, you will see an error message similar to the following:

The log scan number (227:418:1) passed to the log scan operation in database ' master ' is not valid. This error may indicate data corruption, or the log file (. ldf) does not match the data file (. mdf). If this error occurs during replication, recreate the publication. Otherwise, if the problem causes an error during startup, restore from a backup.

There are roughly three ways to resolve corruption in the master database at this point:

1: Restore the master database from backup

The prerequisite for restoring the master database is that your master has a backup. Never forget that master must also be backed up. Many times, some people will ignore these system databases when they back up. The general master, msdb backup is required.

2: Copy the master database template

If you do not have a master backup, then go back and choose to copy the master database file from the installation directory to the corresponding directory templates. If you have SQL Server installed on the C drive and you have not modified the installation path, you may be C:\Program Files\Microsoft SQL Server\mssql10. Mssqlserver\mssql\binn\templates

3: Rebuilding the master database

Locate the installation media for SQL Server 2008 (insert disc or copy media to the corresponding directory), and in the command window, change the directory to the directory where the Setup.exe file is located, and then run the following command (with the actual situation to modify the relevant parameters)

Setup.exe
/quiet
/action=rebuilddatabase
/instancename=instance_name
/sqlsysadminaccounts= accounts
[/sapwd=password]
[/sqlcollation=collation_name]

Of course there are a lot of details, if the database installed after patching, did upgrade, you may need to reapply these patches. Specifically refer to the blog "How to Rebuild System Databases in SQL Server 2008".

SQL Server-master database Corruption resolution summary

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.