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.