locked
error while restoring the db RRS feed

  • Question

  • Dear friends,

    I got this below error while restoring the db ,here i have taken backup from adventure_primary--database and restoring it on another instance in that to restore purpose i am using advenre_second  database ,give solution.

    Restore failed for Server 'OMM-PC\SECONDARYINSTANC'.  (Microsoft.SqlServer.SmoExtended)

    ------------------------------
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

    ------------------------------
    Program Location:

       at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)
       at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseOptions.RunRestore()

    ===================================

    System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'adventure_second' database. (Microsoft.SqlServer.Smo)

    ------------------------------
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&LinkId=20476

    ------------------------------
    Program Location:

       at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages)
       at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
       at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)


    Pavan

    Sunday, May 27, 2012 12:40 PM

Answers

  • System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'adventure_second' database. (Microsoft.SqlServer.Smo)

    You'll need to specify the WITH REPLACE option to overwrite the existing adventure_second database with a backup taken from a different database.  From the SSMS GUI, select WITH REPLACE under Options.  In T-SQL, specify the WITH REPLACE option.  You may need to also change the physical file names.


    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/

    Sunday, May 27, 2012 1:06 PM