July 22, 2013 at 10:37 am
I am new to SQLServer2008 clustering , When I try to restore a database within the cluster , I get the message Couldnt obtain exclusive access, I guess this has something to do with the database being in the cluster
Can anyone shed some light on this issue ?
July 22, 2013 at 10:50 am
Some connection is using the database. This is nothing to do with cluster. Find out the connection and disconnect it. To restore a database on the existing database, it requires an exclusive lock. Since some users are using that database, SQL server fails to acquire an exclusive lock, which causes the error.
To find the session that is using the database:
select spid, status, loginame, db_name(dbid), cmd from master.sys.sysprocesses where db_name(dbid) = 'DB_NAME'
Find out the activity that is going on the database
DBCC INPUTBUFFER(<SPID NUMBER>)
Disconnect the session:
KILL <SPID NUMBER>).
July 22, 2013 at 10:54 am
Make sure it's not your connection using the database. Change database context to master before you run the restore.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 22, 2013 at 12:32 pm
Thanks , it looked to be a SSMS session , works fine now
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply