DBCC CHECK DB ERROR

  • When we run DBCC CHECKDB on one of our production Server we get the below error..

    Error:--The database could not be exclusively locked to perform the operation.

    Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked.

    Please required help for this issue..

  • There should be more errors in the error log than just that. Please find them and post them here.

    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
  • I am unable to find any thing in the error log because the DBCC CHECK DB did'nt complete before completing it gave the above error...

  • I'm not talking about the checkDB completion messages. Is there nothing else before that in the error log, maybe hinting as to why it's trying to lock tables?

    Actually... What is the exact checkDB command you're running?

    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
  • There is nothing in the errorlog prior to running checkdb which can help us.

    We are running check db through maintanence plan.

  • No error messages about trying to create a snapshot? No error messages about failing to create a snapshot? About CheckDB being unable to run online?

    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
  • No there is no such error.

    Do we need to enable any trace flag for that so that its is visible in the errorlog

  • Nope.

    Without any errors saying why CheckDB went for tablock (which is not default), not going to be possible to figure this out. Something prevented the creation of the database snapshot, could be any number of things.

    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
  • Hi There,

    Please check for any transactions that are currently running against the Database... Check for any open transactions and see if they can be stopped for the time being.

    The best thing would be to get the Database into a single user mode and perform the DBCC checks.

    Let us know how it went..

    Cheers,

    Praveen Nakka

  • CheckDB does not require that the DB be in single user mode or that there be no transactions running (that's repair). It normally runs as an online operation. The root problem here is not that it couldn't lock the tables, but that it tried to run with the tablock option for no apparent reason.

    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
  • If log says nothing about this problem there is way through which root cause can be trace out with using profiler.Lets on profiler when you going to run checkdb and check what is actually happening on backend.

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply