Data Protector MSSQL RESTORE is failing with the below error

[Critical] From: OB2BAR_DB2_0@iwf1113151.cdoma.local "SQLPRIMARY"  Time: 8/9/2022 3:01:19 PM
    Virtual Device Interface reported error:
The object was not open.

   See also debug.log and SQL Server error log for details.

[Normal] From: OB2BAR_DB2_0@iwf1113151.cdoma.local "SQLPRIMARY"  Time: 8/9/2022 3:01:21 PM
    Completed OB2BAR Restore: 15.218.113.151:/SQLPRIMARY/DB2/0 "MSSQL"

[Major] From: OB2BAR_DB2_0@iwf1113151.cdoma.local "SQLPRIMARY"  Time: 8/9/2022 3:01:21 PM
    Aborting connection to RSM. Abort code -2.

[Normal] From: OB2BAR_SQLBAR@iwf1113151.cdoma.local "SQLPRIMARY"  Time: 8/9/2022 3:01:29 PM
    Restore of database is complete.
    Integration agent is waiting for SQL Server to perform recovery of the restored database.

[Major] From: OB2BAR_SQLBAR@iwf1113151.cdoma.local "SQLPRIMARY"  Time: 8/9/2022 3:01:29 PM
    Error has occurred while executing a SQL statement.
    Error message: 'SQLSTATE:[42000] CODE:(3101) MESSAGE:[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Exclusive access could not be obtained because the database is in use.
SQLSTATE:[42000] CODE:(3013) MESSAGE:[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]RESTORE DATABASE is terminating abnormally.
'

[Major] From: OB2BAR_SQLBAR@iwf1113151.cdoma.local "SQLPRIMARY"  Time: 8/9/2022 3:01:29 PM
    Aborting connection to RSM. Abort code -24.

[

  • Verified Answer

    Hello

    What DP and SQL version are you using? What database type are you restoring? Does it master or msdb database?

    have you tried to use this option?

    Force restore over the existing database Select this option if a database with the same name but a different internal structure already exists at the target Microsoft SQL Server instance.

    If this option is not selected, the Microsoft SQL Server does not let you overwrite the existing database - the restore will fail.

    If you are restoring a data file from the PRIMARY group to an existing database, you must specify the option at the data file level.

    When using this option, make sure that the most recent logs are backed up before the restore.

    Please NOTE that database will be overwritten if you check this option.

    Best Regards

  • Worked after closing the existing connections and made a fresh connection .