SQL Server logical file ' is not part of database '. Please use RESTORE filelistonly to list the logical file names.

Source: Internet
Author: User

When you use a statement to restore a database, the following error is reported:

Msg 3234, Level 16, State 2, line 29th
The logical file ' lenbormealorder_base_2017 ' is not part of the database ' members_01 '. Please use RESTORE filelistonly to list the logical file names.
Msg 3013, Level 16, State 1, line 29th
RESTORE DATABASE is terminating abnormally.

Cause: This database was backed up with an SQL statement, resulting in an error, the original backup and restore SQL statements are as follows:

--BackupBACKUP DATABASElearunframework_base_2016 to DISK  = 'C:\DB_BACKUP\LenborMealOrder_Base_2017.bak'--RestoreRESTORE DATABASEMembers_01 from DISK  = 'C:\DB_BACKUP\LenborMealOrder_Base_2017.bak'  withMOVE'lenbormealorder_base_2017'  to 'C:\DB_BACKUP\Members_01.mdf', MOVE'Lenbormealorder_base_2017_log'  to 'C:\DB_BACKUP\Members_01.ldf'

Solution: Find the logical file name of the data, use the following statement to find out, and then modify the name in the RESTORE statement.

--restorefromdisk='c:\DB_BACKUP\LenborMealOrder _base_2017.bak'

The modified restore statements are as follows:

--RestoreRESTORE DATABASElenbormealorder_base_2017 from DISK  = 'C:\DB_BACKUP\LenborMealOrder_Base.bak'  withMOVE'learunframework_base_2016'  to 'C:\DB_BACKUP\LenborMealOrder_Base_2017.mdf', MOVE'Learunframework_base_2016_log'  to 'C:\DB_BACKUP\LenborMealOrder_Base_2017.ldf'


Executing the above statement successfully restores the database, such as:

SQL Server logical file ' is not part of database '. Please use RESTORE filelistonly to list the logical file names.

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.