DBCC CHECKDB blocking itself

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

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

  • 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

  • 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

    This kind of explains the behaviour. What would be the work around apart from waiting the 20+ hours?

  • Blocking by the same process itself is not a big problem .

  • 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

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

Viewing 7 posts - 1 through 6 (of 6 total)

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