Summary of recovering database problems with Bak file

Source: Internet
Author: User

RESTORE filelistonly from DISK = ' E:\bbs8.1\Dvbbs8.1.0_SQL\Data\sq_ebendegfzds_bkp_1.bak '

Go

The above text lists the logical name (LogicalName) of the. bak file that you want to restore. The logical names of the. mdf and. LDF in this example are "Sq_ebende_data" and "Sq_ebende_log", respectively, with logical names to restore the database

The statement is:

Restore Database name

From disk= ' backup file path '

With

Move '. mdf file logical filename '

To '. MDF path to restore to '

The logical file name of the move '. log file '

To '. Log path to return to '

Go

Here is an example:

Where the red part is the logical file name, if it is not correct, the following error will occur

Server: Msg 3234, Level 16, State 2, line 2
The logical file ' Sq_ebende ' is not part of the database ' Sq_ebende '. Please use RESTORE filelistonly to list the logical file names.

Restore Database Sq_ebende

From disk= ' E:\Data\sq_ebendeg_bkp_1.bak '
With Replace,move ' Sq_ebende_data '

To ' E:\Data\sq_ebende.mdf ',
Move ' Sq_ebende_log '
To ' E:\\data\sq_ebende.ldf '
Go

Because, the backup file name is ' Sq_ebende_bkp_1.bak ' easy to think that the logical file name is Sq_ebende, in fact, it is not necessarily, it is best to use the restore FILELISTONLY from DISK to view.

Summary of recovering database problems with Bak file

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.