hi there, need help please :(
I've made backup for my database. we use SQL 2008 R2 as database engine, and Dynamic SL 2011.
suddenly I got mistake for the data, and wanna to recover the database.
here are the chronology:
- database deleted by accident (DB application and DB system).
- I re-create new empty database with same name (both for DB application and DB system).
- When I want to restore the database, shown an error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Restore failed for Server 'MS001'. (Microsoft.SqlServer.SmoExtended)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
The backup set holds a backup of a database other than the existing 'DATAsys' database.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3154)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=3154&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
******************************************************************
- ths also happen to DB application.
- already tried for options:
overwrite the existing database (with replace)
restore with recovery
restore with nonrecovery
still no hope. need help please. thanks in advance.
*This post is locked for comments
Above described method is gud but if u r stiil facing the problem and your sql server showing error 3154 then u can go through this blog to know more about the cause and recovery http://sqlrecoverysoftware.net/blog/sql-server-error-3154.html
hi,
work perfectly. thanks for help :)
Hi Rodi
Cause for the Issue:
------------------------------
The backup set is a backup of a database with the same name as the database to which you are restoring. However, the database being restored was created by a different CREATE DATABASE statement than the database in the backup set. Even though the databases have the same name, they are in fact different databases.
Solution:
-----------------
Either overwrite the existing database by reissuing the RESTORE DATABASE command using the WITH REPLACE clause, or restore the backup set to a different database name. If you restore the backup set to a different database name, ensure that the files that will be created do not already exist and are not being used by another database. If you chose the wrong backup set to restore, select a backup of the existing database and restore it.
Sample Overwrite SQL Query:
----------------------------------------------
RESTORE DATABASE DATAsys
FROM DISK = 'C:\DATAsys.bak' --(Mention the exact DB backup file path)
WITH REPLACE
Thanks
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156