Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Restore Database Failed: 'Exclusive access could not be obtained because the database is in use.' Expand / Collapse
Author
Message
Posted Tuesday, April 5, 2011 7:35 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 4:12 PM
Points: 4,386, Visits: 9,502
Grant Fritchey (4/5/2011)
True, but I prefer to not let anyone have privileged access to the server except other DBAs.


Of course, I would prefer that also - but I have various systems where the vendors have setup their applications to use privileged accounts. I don't have a choice...unfortunately.


Jeffrey Williams
Problems are opportunites brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs
Post #1088989
Posted Thursday, September 27, 2012 12:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, November 19, 2012 3:53 AM
Points: 1, Visits: 11
In my case: I was logged in to SSMS as 'user_x'. Default database for 'user_x' was 'Test_DB'.
I got same errormessage when I tried to restore in this session 'Test_DB'.

When I logged out as 'user_x' and logged in SSMS as another user (that did not have default database 'Test_DB'), restore was successful.
Post #1365048
Posted Thursday, September 27, 2012 12:30 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 7:57 AM
Points: 802, Visits: 1,355
Good.

Thanks.
Post #1365051
Posted Thursday, September 27, 2012 4:48 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, March 6, 2014 1:35 AM
Points: 178, Visits: 547
Make sure no other instances of SSMS are open.
If you have multiple tabs open, make sure they are not pointing to the DB in question.

You could also try restarting the service.

Any replication going on? Or any other jobs or triggers pointing to your troublesome DB?




For better, quicker answers on T-SQL questions, read Jeff Moden's suggestions.

"Million-to-one chances crop up nine times out of ten." ― Terry Pratchett, Mort
Post #1365136
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse