Fast implementation of SQL Server database recovery backup _mssql

Source: Internet
Author: User

This article for everyone to share the SQL Server database recovery backup two methods for your reference, the specific contents are as follows

The first approach: usually we use the way to restore backup, select the target database, select the source device for recovery.
Screenshot below:

The second way: This is sometimes inconvenient, and scripting is more convenient, using the following script.

/*
backup Data db to. bak file. Then use this BAK file to restore a new database dbtest.
*/
Use master
BACKUP DATABASE DB to 
 disk = ' E:\DBTest.bak '
 
RESTORE filelistonly from 
 DISK = ' E:\DBTest.bak ' 

RESTORE DATABASE dbtest 
 From DISK = ' E:\DBTest.bak ' 
 and 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 = ten, REPLACE go
 

Note:

STATS = 10% shows one record per completion
REPLACE Use BAK to restore the database, force restore
dbtest and dbtest_log are above g:\back. The logical file in Bak

The above is the SQL Server database restore backup method, I 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.