Quick Recovery and backup of SQL Server databases

Source: Internet
Author: User

Quick Recovery and backup of SQL Server databases

This article provides two methods for restoring the backup of SQL Server database for your reference. The specific content is as follows:

Method 1:We usually adopt the Backup recovery method, select the target database, and select the Source Device for recovery.
As follows:

Method 2:This method is sometimes inconvenient, and the script method is more convenient. The script method is as follows.

/* Back up the data DB to The. bak file. Then, use the bak file to restore a new database DBTest. */USE masterBACKUP database db to disk = 'e: \ DBTest. bak 'Restore filelistonly from disk = 'e: \ DBTest. bak 'Restore DATABASE DBTest from disk = 'e: \ DBTest. bak 'with move 'dbtest' TO 'e: \ Program Files \ Microsoft SQL Server2005 \ Data \ DBTest. mdf ', MOVE 'dbtest _ log' TO 'e: \ Program Files \ Microsoft SQL Server2005 \ Data \ DBTest_log.ldf', STATS = 10, REPLACEGO

Note:

STATS = 10One record is displayed for every 10% completed
REPLACEUse bak to restore the database and force restore
DBTestAndDBTest_logIs the logical file in g: \ back. Bak above.

The above is the SQL Server Database Backup recovery method, hope to help you learn.

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.