How to recover the system database?

zhaozj2021-02-16  44

How to recover how the system database restores the system database?

The recovery summary of the system database is summarized as follows: In the SQL Server database, the system information is stored in the system database, and the main system database includes: master- controlling the user database and SQL Server operation, after creating any user-defined objects It is necessary to back up it Model-Provide templancies and prototypes for new databases. MSDB- contains information about jobs, alarms, and operators. If the media containing the system database changes, then you must rebuild the system database, if you can still start SQL Server service The database can be restored from the system database backup via the RESTORE statement. If MASTER is broken, you cannot start the system, you can follow the steps below 1 Reconstruction System Database Run C: /Mssql7/binn/rebuildm.exe, follow the prompts, you need the path to the system database sample, you can install the disc Found;

2 After rebuilding the system database, start the SQL Server service, recover the database with the system database, the usual recovery order is Master-> msdb-> model When restoring Master backup: must be done in Single User mode, Several methods enters single-user mode: 1 You can enter SQLSERVR-C -F -M in command line mode, or enter SQLSERVR -M in which: -c can shorten the startup time, SQL Server does not act as a service startup of Windows NT -f-F uses minimum Configuring SQL Server -M Single User Mode Start SQL Server 2 You can enter -c -f -m or input -m in the launch parameter of the control panel - MSSQLServer, click to start

3 There is also a more flexible startup method: starts to add items to the MSSQLServer item with the startup parameters in the registry, 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: /msql7/data/mastlog.dat sqlarg3: reg_sz: -m Enter SQLSERVR in the command line - c -ssingleuser, Note: You must start Query after entering a single user mode under the command line.

Analyzer Execute Statement: RESTORE DATABASE MASTER FORM Disk = 'C: / (Specific Backup File Name)

转载请注明原文地址:https://www.9cbs.com/read-26083.html

New Post(0)