restoring System Databases

Source: Internet
Author: User
Tags command line contains mssqlserver sql backup

msdb-contains information about jobs, alarms, and operators if the media containing the system database has changed, the system database must be rebuilt, and if you can still start the SQL Server service, you can recover the database from the backup of the system database through the RESTORE statement.

A summary of the recovery of the system database is as follows:

In a SQL Server database, System information is stored in the system database, and the primary system databases include:

master-controls user databases and SQL Server operations as a whole, and backs up any user-defined objects after they are created.
Model-provides templates and prototypes for new databases
msdb-contains information about jobs, alarms, and operators if the media containing the system database has changed, the system database must be rebuilt, and if you can still start the SQL Server service, you can recover the database from the backup of the system database through the RESTORE statement.

If Master does not boot the system, you can follow the steps below to restore

1, the rebuilding system database runs C:\mssql7\binn\rebuildm.exe, according to the prompt can, the process needs the System database sample path, may find in the installment CD-ROM;

2. After rebuilding the system database, start the SQL Server service, restore the database with the system database backup. Typically, the restore order is master->msdb->model when restoring Master's backup: it must be done in single user mode, There are several ways to do this:

Enter single user mode:
1, can enter sqlservr-c-f-m or input sqlservr-m in command line mode
Where:-C can shorten startup time, SQL Server does not start as Windows NT service
-F Start SQL Server with minimal configuration
-m single-user mode starts SQL Server
2. You can enter-c-f-m or input-m in the Control Panel-service-mssqlserver startup parameters, click Start
3, there is also a more flexible way to start: with the presence of the registration table startup parameters to start, under the MSSQLServer key to add items SingleUser, the details are as follows:
HKEY_Local_Machine
\software
\microsoft
\MSSQLServer
\singleuser
\parameters
SQLARG0:REG_SZ:-dc:\mssql7\data\master. Dat
SQLARG1:REG_SZ:-ec:\mssql7\log\errorlog
SQLARG2:REG_SZ:-lc:\mssql7\data\mastlog. Dat
SQLARG3:REG_SZ:-M
Enter Sqlservr-c-ssingleuser at the command line, note: You must start Query Analyzer execution statement after entering Single-user mode at the command line:
RESTORE DATABASE Master Form disk= ' C:\ (specific backup file name)



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.