SQL server 2005 database restoration error 3154

Source: Internet
Author: User

Let's take a look at our error prompt.

Error message: the backup of the DATABASE in the backup set is different from the existing "XXXXXX" DATABASE, and the restore database is terminated abnormally.

The cause of this error is that the physical address of the backup database changes in the restoration environment.

Solution:

The reason is that the file name and physical address of the backup database have changed in the restoration environment.
If such an error occurs

1. Execute the following SQL code (you must first select your database and then execute the following code ):

The code is as follows: Copy code

Restore database sqlname from disk = 'd: BAKSQLNAME. bak 'with replace,
MOVE 'sqlname' TO 'D: Microsoft SQL ServerMSSQL.1MSSQLDataSQLBAK. mdf ',
MOVE 'sqlname _ log' TO 'D: Microsoft SQL ServerMSSQL.1MSSQLDataSQLBAK _ log. Ldf'

Or operate in full command mode

The code is as follows: Copy code
USE MASTER
Restore database EMS _ONLINE
From disk = 'E: PROJECTEMS100902DATAEMS_ONLINE_BACKUP_201006091204.BAK'
With move 'EMS _ online' TO 'E: PROJECTEMS100902DATAEMS_ONLINE.MDF ',
MOVE 'EMS _ ONLINE_LOG' TO 'E: PROJECTEMS100902DATAEMS_ONLINE_LOG.LDF ',
STATS = 10, REPLACE
GO

 

SQLNAME is the database name, and SQLNAME. bak is the backup.

Note: The preceding SQL path can be operated based on the server address.

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.