Blog Post

Error : DBCC could not obtain a lock on this object because the lock request timeout period was exceeded

,

DBCC CheckDB failed with error “DBCC could not obtain a lock on this object because the lock request timeout period was exceeded”

Error: Today, My DBCC checkdb job failed with below error.

Executed as user: USERNAME. Object ID 451805713 (object ‘dbo.AEETBL’): DBCC could not obtain a lock on this object because the lock request timeout period was exceeded. This object has been skipped and will not be processed. [SQLSTATE 42000] (Error 50000) DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Issue: When I see this error, I ask a question to myself “Does DBCC CHECKDB perform locks?” and the answer is NO. From SQL Server 2005 onwards, DBCC CheckDB works on a hidden database snapshot. A database snapshot is a read-only copy of the database. You can see some blocking on server or slowness for users due to snapshot I/O overhead but for sure no LOCKS.

Cases when DBCC CHECKDB take lock: –

  1. If the TABLOCK option is specified when executing DBCC CheckDB
  2. If hidden database snapshot is not created due to performance reasons or lack of disk space

So, It’s time to check my code and disk space. I found my DBCC CheckDB job is running with TABLOCK which cause this issue. This is not a common thing to use. If you are using TABLOCK you should have valid reasons like either slow disk system or low disk space.

Some people said they used TABLOCK to avoid I/O overhead of snapshot. For those, I need to mention “it’s higher to possess one thing in situ of nothing”. Microsoft suggests running DBCC Checkdb in odd business hours so that user performance is minimally impacted.

Reference: Rohit Garg (http://mssqlfun.com/)

You can find and follow MSSQLFUN:-

http://www.facebook.com/mssqlfun

http://mssqlfun.com/feed

https://twitter.com/Rgarg86

Other Linked Profiles:-

http://social.msdn.microsoft.com/Profile/rohitgarg

http://www.sqlservercentral.com/blogs/mssqlfun/

http://www.toadworld.com/members/rohit-garg/blogs/default.aspx

http://beyondrelational.com/members/RohitGarg/default.asp

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating