SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBCC CHECKDB blocking itself


DBCC CHECKDB blocking itself

Author
Message
Mohammed Imran Ali
Mohammed Imran Ali
Mr or Mrs. 500
Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)

Group: General Forum Members
Points: 539 Visits: 258
Hi,

DBCC CHECKDB on a ~600GB database and is taking quite a while to complete recently (~20 hrs). It completed in around 2 hrs.

While looking at it, the process running the DBCC CHECKDB command is blocking itself. The lastwaittype says as LATCH_EX and waitresource is DBCC_OBJECT_METADATA ().

Any help to improve this is much appreciated.

Cheers,
free_mascot
free_mascot
SSCertifiable
SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)

Group: General Forum Members
Points: 7601 Visits: 2250
Usually DBCC CHECKDB should be executed during off-peak hours. What is type of server? i.e. prod, dev, test? what is the size of database? Command blocking spid is same as executing? Do you found any error in error log?

Check following link might help you:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/030b1c5a-f8ef-49a1-893d-50dffd71a84a/dbcc-checkdb-blocking-itself-sql-2008-mscrm

HTH

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Andrew G
Andrew G
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4113 Visits: 2285
Are you on SQL2008R2 SP2? http://support.microsoft.com/kb/2634571
http://blogs.msdn.com/b/psssql/archive/2012/02/23/a-faster-checkdb-part-ii.aspx

Try DBCC CHECKDB WITH PHYSICAL_ONLY
Mohammed Imran Ali
Mohammed Imran Ali
Mr or Mrs. 500
Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)

Group: General Forum Members
Points: 539 Visits: 258
free_mascot (12/23/2013)
Usually DBCC CHECKDB should be executed during off-peak hours.


DBCC scheduled to run off-peak hours

What is type of server? i.e. prod, dev, test?

PROD
what is the size of database? Command blocking spid is same as executing? Do you found any error in error log?


~600GB is the size of the DB and the same spid is blocking itself. Of the 17 threads spawned, 7 are blocking itself with the waittype LATCH_EX and the remaining are waiting on CXPACKET


http://support.microsoft.com/kb/906344/en-us


This kind of explains the behaviour. What would be the work around apart from waiting the 20+ hours?
VastSQL
VastSQL
SSCrazy Eights
SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)

Group: General Forum Members
Points: 9736 Visits: 5312
Blocking by the same process itself is not a big problem .
Mohammed Imran Ali
Mohammed Imran Ali
Mr or Mrs. 500
Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)Mr or Mrs. 500 (539 reputation)

Group: General Forum Members
Points: 539 Visits: 258
Ratheesh.K.Nair (12/23/2013)
Blocking by the same process itself is not a big problem .


Is there any other way to improve the execution time (has gone from 2 hrs to 20+ hrs) apart from just waiting
mark.umbach
mark.umbach
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 119
I have found the exact same issue. Does anyone have a solution yet? On production I am doing a physical_only so the time there is not a problem but I am restoring the backup to another server in order to do a CHECKDB to make sure everything is in order. I pinpointed in down to a single table and the DBCC CHECKTABLE is taking 11 hours on a 1.1 billion row table that has a clustered index on two columns (int, bigint) and a non-clustered index on a single int column. There are no relationships.

Literally 100% latch time is DBCC_OBJECT_METADATA and it is always waiting on CXPACKET. There is a lot more CPU than I/O.

This is running on WS2012 std, SQL2012 SP2 (11.0.5569.0). 4 CPU, 12G.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search