The recovery of the system database is summarized as follows:
In the SQL Server database, the system information is stored in the system database. The main system databases include master, which controls the user database and SQL server operations as a whole, after creating any User-Defined Object, back up it:
Model-provides templates and prototypes for new databases
MSDB-contains information about jobs, alarms, and operators
If the media that contains the system database changes, you must re-build the system database. If you can still start the SQL Server service, you can use the restore statement to restore the database from the backup of the system database. If the master node fails and the system cannot be started, follow these steps:
1. Rebuild the system database and run C: mssql7binnrebuildm.exe. Follow the prompts to find the path of the system database sample during the process, which can be found on the installation disc;
2. after the system database is rebuilt, start the SQL Server service and use the backup of the system database to restore the database. Generally, the recovery sequence is master> MSDB> model. When restoring the backup of the master, pay attention to the following: it must be in single user mode. There are several ways to enter Single User Mode:
1. you can enter sqlservr-C-F-m in command line mode or sqlservr-M, where-C can shorten the startup time, SQL Server is not started as a Windows NT Service-F start SQL Server in single-user mode with minimum configuration
2. You can enter-C-F-M or-m in the startup parameters of control panel-service-MSSQLServer, and click Start.
3. There is also a more flexible startup method: Start with a startup parameter that exists in the Registry
Add the singleuser entry under MSSQLServer, as shown in the following figure:
HKEY_LOCAL_MACHINE
Software
Microsoft
MSSQLServer
Singleuser
Parameters
Sqlarg0: REG_SZ:-DC: mssql7datamaster. dat
Sqlarg1: REG_SZ:-EC: mssql7logerrorlog
Sqlarg2: REG_SZ:-LC: mssql7datamastlog. dat
Sqlarg3: REG_SZ:-m
Enter sqlservr-C-ssingleuser in the command line. Note: You must start query analyzer to execute the statement after entering single-user mode in the command line:
Restore database master form disk = 'C :( specific backup file name )'