Backup and restore of SQL Server master database

Source: Internet
Author: User
Tags configuration settings mssqlserver

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

Related Article

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.