Restore user database within a SQLServer 2008 failover cluster

  • 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 ?

  • 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>).

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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