I need to restore a copy of database to a new db name
i'm trying by creating a new db and restoring by doing
RESTORE DATABASE [userr] FROM DISK = N'D:\sqlbackups\user.bak' WITH FILE = 4, NOUNLOAD, STATS = 10
GO
i'm getting an error
Msg 3154, Level 16, State 4, Line 1
The backup set holds a backup of a database other than the existing 'userr' database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
What's the best way to do this?Apparently what you believe to be FILE = 4 and what the RESTORE finds in FILE = 4 is not the database you believe it to be.
Post the results of RESTORE HEADERONLY for the backup device please, and let's work from there.
BTW is the name of the database you are looking for "user" or "userr"?|||If this restore is going on the same instance as the original database, you will also need to move the physical files in the restore command.|||what's restore headeronly?
i'm trying to restore a backup from user to userr|||i'm restoring to a new db.
I don't want to lose my backups or touch my regular db in anyway
what's the best way to do this?|||what's restore headeronly?
i'm trying to restore a backup from user to userr
Check BOL!!|||If this restore is going on the same instance as the original database, you will also need to move the physical files in the restore command.
True, but I figure one problem at a time ... the RESTORE command, as he provided it, is trying to pull one backup out of a backup set ... a database named 'userr' ... and RESTORE says it is not at file position 4. Once we find the correct backup, we will work with "WITH MOVE".|||Yeah, but userr is the destination name, not the source name. I agree there may be a problem with the backup file (such as no fileID 4), but restore should pick up whatever backup is in slot 4, and restore it under the new name. I have not fiddled with this bit, since backing up everything to one file is a bit riskier than I like, so I have never had a reason to experiment with it.|||so what is the best way to do this - I urgently need to restore to a new db.|||why dont you use the restore option from enterprise manager... It is lot more easier...|||Backup and restore is the best way.
No comments:
Post a Comment