No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

The SQL Server Restoration Fails and Error Message status code 5: Exclusive access could not be obtained because the database is in use Is Displayed

Publication Date:  2015-07-29 Views:  73 Downloads:  0
Issue Description
After the SQL server database is backed up, the database restoration fails. The error message is status code 5: Exclusive access could not be obtained because the database is in use.

Handling Process
Method 1: Restart the SQL server instance and perform database restoration again.

Method 2: Disconnect the database to be restored in the SQL Server Enterprise Manager. Then, connect the database to the network and perform database restoration again.
Root Cause
Possible Causes:

The error message cannot identify problem causes. You must collect more logs to analyze the problem causes.

Fault Diagnosis:

1.  Create the dbclient directory in \$NetBackup_Install_Derectory\Netbackup\logs on the SQL server.

2.  Perform database restoration again.

3.  Check the logs collected in dbclient. The log is as follows:

OPERATION RESTORE
OBJECTTYPE DATABASE
DATABASE "Northwind"
# The following image is type: Full
NBIMAGE "sqltest.MSSQL7.SQLTEST.db.Northwind.~.7.001of001.20110708151755..C"
SQLHOST "sqltest"
NBSERVER "NBUYYL"
BROWSECLIENT "sqltest"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
RESTOREOPTION REPLACE
RECOVEREDSTATE RECOVERED
NUMBUFS 2
ENDOPER TRUE
INF - RESTORE STARTED USING
Microsoft SQL Server  2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
Batch = C:\Program Files\Veritas\NetBackup\dbext\mssql\temp\__16_11_42_359_00.bch, Op# = 1.
INF - Using backup image sqltest.MSSQL7.SQLTEST.db.Northwind.~.7.001of001.20110708151755..C
INF - restore database "Northwind" from VIRTUAL_DEVICE='VNBU0-25184-25196-1310112704' with blocksize = 65536, maxtransfersize = 4194304, buffercount = 2, replace , norecovery
INF - Number of stripes: 1, Number of buffers per stripe 2.
INF - Created VDI object for SQL Server instance <sqltest>. Connection timeout is <300> seconds.
ERR - Error in GetConfiguration: 0x80770003.
    CONTINUATION: - The api was waiting and the timeout interval had elapsed.
DBMS MSG - ODBC return code <-1>, SQL State <37000>, SQL Message <3101><[Microsoft][ODBC SQL Server Driver][SQL Server] Exclusive access could not be obtained because the database is in use.>.
DBMS MSG - SQL Message <3013><[Microsoft][ODBC SQL Server Driver][SQL Server] RESTORE DATABASE RESTORE DATABASE is terminating abnormally.>
ERR - Error found executing <restore database "Northwind" from VIRTUAL_DEVICE='VNBU0-25184-25196-1310112704' with blocksize = 65536, maxtransfersize = 4194304, buffercount = 2, replace , norecovery>.
ERR - Error in VDS->Close: 0x80770004.
    CONTINUATION: - An abort request is preventing anything except termination actions.
INF - OPERATION #1 of batch C:\Program Files\Veritas\NetBackup\dbext\mssql\temp\__16_11_42_359_00.bch FAILED with STATUS 1 (0 is normal). Elapsed time = 308(0) seconds.
INF - Results of executing <C:\Program Files\Veritas\NetBackup\dbext\mssql\temp\__16_11_42_359_00.bch>:
<0> operations succeeded. <1> operations failed.


    The log information shows that the database is in use so that the system cannot obtain the exclusive access permission for accessing the database. As a result, database restoration fails.

END