sql2008 Restore Database Solution _mssql2008

Source: Internet
Author: User
--Returns a result set consisting of a list of databases and log files contained in the backup set.
--Get the logical file name mainly
Restore FILELISTONLY from disk = ' E:/levws.bak '

/*
Recover the database with Bak, Force restore (REPLACE)
STATS = 10 Displays one record per completion 10%
Dbtest and Dbtest_log are above g:\back. The logical file in Bak
*/
Copy Code code as follows:

Use master
RESTORE DATABASE Levws
From DISK = ' E:\levws.bak '
With move ' levws_data ' to ' E:\levws_Data.MDF ',
Move ' levws_log ' to ' E:\levws_Log.LDF ',
STATS = ten, REPLACE
Go

Results:
374352 pages have been processed for the database ' Levws ', file ' Levws_data ' (located on file 1).
1 pages have been processed for the database ' Levws ', file ' Levws_log ' (located on file 1).
Converting database ' Levws ' from version 539 to current version 655.

The RESTORE DATABASE successfully processed 374353 pages, costing 205.725 seconds (14.216 MB/s).

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.