What are the solutions to master database corruption? master database

Source: Internet
Author: User
Tags sql server books

What are the solutions to master database corruption? master database

After the SQL Server 2008 master database is damaged, the SQL SERVER service fails to start. view the error log and you will see the following error message:

10:15:21. 01 spid6s Starting up database 'master '.
10:15:23. 01 spid6s error: 9003, severity: 20, status: 1.
10:15:23. 01 spid6s The log scan number (227:418:1) passed to log scan in database 'master' is not valid. this error may indicate data Partition uption or that the log file (. ldf) does not match the data file (. mdf ). if this error occurred during replication, re-create the publication. otherwise, restore from backup if the problem results in a failure during startup.
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 about how to rebuild the master database, see SQL Server Books Online.

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

The log scan number (227:418) for the log scan operation passed to the database 'master' is invalid. This error may indicate data corruption, or the log file (. ldf) does not match the data file (. mdf. If this error occurs during replication, create a new release. Otherwise, if this problem causes an error during startup, please restore it from the backup.

There are roughly three methods to solve the damage to the master database:

1: Restore the master database from backup

The premise for restoring the master database is that your master has a backup. Remember that the master must also be backed up. Many times, some people will ignore these system databases during Backup. Generally, backup of master and msdb is required.

2: copy the master database template

If you do not have a master backup, go back to the next step and choose to copy the master database file from the Templates directory of the installation directory to the corresponding directory. If you have not modified the installation path of SQL server on disk C, it may be C: \ Program Files \ Microsoft SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ Binn \ Templates.

3: rebuilding the master database

Find the installation medium of SQL Server (the plug-in or beibeijiejiao to the corresponding directory, change the directory to the directory where the setup.exe file is located in the Command window, and then run the following command (modify the relevant parameters according to the actual situation)

setup.exe/QUIET/ACTION=REBUILDDATABASE/INSTANCENAME=instance_name/SQLSYSADMINACCOUNTS= accounts[/SAPWD=password][/SQLCOLLATION=collation_name]

Of course, there are many details. If the database has been installed with patches and has been upgraded, you may need to apply these patches again.

The above is a solution to the damage to the master database. I hope it will help you.

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.