Knowledge section
System database: SQL Server R2 includes four system databases by default, master, model, msdb, tempdb, respectively. The master database is used to record all system-level information, all login accounts, and system configuration settings. All other database information is also logged, including the location of the database files, as well as the initialization information for all SQL Servers. If there is a problem with the master database, it will cause the whole database to crash and be unusable, causing huge losses to the enterprise. So doing a good job of backing up the master database is a must for a qualified DBA.
Operation section
1, first we create a database for experimentation, "database" in which a table "student" is used to test whether the restoration is successful.
2. and create a new login name
3, the first step, we find "server object"-"Backup Device"-"New backup Device"
4. Name the backup device
5. Then right-"Back up the database" to the new "Backup Device"
6. Select Backup "Master"
7. After completion we began to prepare the master of the simulation database failure. First stop the SQL Server (MSSQLSERVER) service.
8. Then locate the master database under the path to delete it.
9, delete and then go to the SSMs tool, there will be errors. The database is not available at this time.
10, the recovery part. We insert the SQL Server R2 CD.
11. Run cmd, input command-enter completed
12. Open Service Management-Locate the SQL Server (MSSQLSERVER) service and edit its properties. Enter "-c-m" in the startup parameter to start the service. Logging into SQL Server again using the SSMs tool will enter single-user mode.
13. Note Entering single-user mode enter "." Here in the server name.
14. Find the location of the backup file.
15. Enter a statement in the new query and execute it to restore the master database
16. Find this service again, leave the startup parameters blank, restart the service
17, then re-login to SSMs, found that the database can be reused.
Backup and restore of SQL Server master database