SQL 2000 or SQL 2005 user database restore fails with the error "Exclusive access could not be obtained because the database is in use" when single user mode is already set on the database that is being restored to.

Article:TECH18466  |  Created: 2002-01-17  |  Updated: 2011-11-14  |  Article URL http://www.symantec.com/docs/TECH18466
Article Type
Technical Solution


Subject

Issue



SQL 2000 or SQL 2005 user database restore fails with the error "Exclusive access could not be obtained because the database is in use" when single user mode is already set on the database that is being restored to.


Error



0x00008492 - Database query failure. See the job log for details.
An Error occurred on a query to database.
V-79-65323-3101 - Exclusive access could not be obtained because the database is in use.


Cause



-This error occurres if there are any active connections to the SQL database are open.
-When the database is in single user mode and the SQL utility was open while attepting the restore job.


Solution



The following need to be verified before attempting the restore job:

1. Verify that single user mode is set in the properties of the database that the data will be restored to (Figure 1)

Figure 1
 

2. Verify that all SQL utilities such as Enterprise Manager, and Query Analyzer are closed
3. Now run the restore job
 
Incase if the job still fails with same error try the following:
 
1. Select the option "Take existing destination database offline" in the Microsoft SQL option under restore job settings.
2. Run the Restore Job.

Supplemental Materials

SourceUMI
ValueV-79-65323-3101
Description

Exclusive access could not be obtained because the database is in use


SourceError Code
Value0x00008492
Description

Database query failure. See the job log for details.



Legacy ID



244730


Article URL http://www.symantec.com/docs/TECH18466


Terms of use for this information are found in Legal Notices