none
Can not put database in offline mode because a lock could not be placed on database

    Question

  • hi,

    One annoying problem has occurred....I want to put database in offline mode....but it is giving me some error...

    "ALTER DATABASE failed because a lock could not be placed on database [database]. Try again later. ALTER DATABASE statement failed. (Microsoft SQL Server, Error: 5061)"

     


    Harry
    Monday, September 12, 2011 1:58 AM

Answers

  • Harry,

    Please check for open transactions on that database that are holding locks. You may use the following query as I posted here.

    select * from sys.dm_tran_locks where resource_database_id=YourDatabaseID
    





    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @PradeepAdiga

    • Marked as answer by Harry SQL DBA Tuesday, September 13, 2011 2:17 AM
    Monday, September 12, 2011 3:56 AM

All replies