On the recovery and backup technology of system database

Source: Internet
Author: User
Tags command line mssqlserver backup
Backup | recovery | data | database

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, then the system database must be rebuilt if you are still
You can start the SQL Server service, you can recover the database from a 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 Rebuild the system database run C:mssql7inn Ebuildm.exe, follow the prompts,

The path of the system database sample is required in the process, which can be found in the installation CD.

2 after rebuilding the system database, start the SQL Server service and restore the database with the backup of the system database

Yes, usually the recovery sequence is Master->msdb->model.
Note When restoring Master's backup: You must do it in single user mode, there are several ways

Enter single user mode:
1 You 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 can be entered-c-f-M or input-m in the Control Panel-service-mssqlserver startup parameter, Dot

Hit start

3 There is also a more flexible way to start: Start with the startup parameters in the registry
Add the item SingleUser under the MSSQLServer entry, as shown below:
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 at the command line, note: You must start Query Analyzer execution statement after entering Single-user mode at the command line:
Restore DATABASE Master from disk= ' (specific backup file name) ' (Data recovery)

Backup DATABASE Master to disk = ' (file name full path) ' (data Backup)



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.