DBCC Update usage on SQL Server 2012

  • Hi SQL Gurus,

    I am doing DBCC updateusage on 5 TB database (SQL server 2012- DB restored from SQL Server 2008). Its running from last 4 hours.

    Any idea how long it can take.

    Thanks

    Kamaldeep.

  • It'll take as long as it takes. Probably quite a while on a large DB like that. Patience.

    Why are you running UpdateUsage on a database upgraded from SQL 2008?

    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
  • Is that not required? What if I rollback? Any side effects?

  • Why are you running it? What made you decide to run that command?

    You can cancel it, just like any other query. May sit rolling back for hours.

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

  • Please ignore my ignorance. What are the criterias where this need s to run.

    I think that this is a standard process after upgrade.

  • singh.kamaldeep (11/28/2013)


    What are the criterias where this need s to run.

    Straight from Books Online

    DBCC UPDATEUSAGE corrects the rows, used pages, reserved pages, leaf pages and data page counts for each partition in a table or index. If there are no inaccuracies in the system tables, DBCC UPDATEUSAGE returns no data. If inaccuracies are found and corrected and WITH NO_INFOMSGS is not used, DBCC UPDATEUSAGE returns the rows and columns being updated in the system tables.

    DBCC CHECKDB has been enhanced to detect when page or row counts become negative. When detected, the DBCC CHECKDB output contains a warning and a recommendation to run DBCC UPDATEUSAGE to address the issue.

    Best Practices

    Do not run DBCC UPDATEUSAGE routinely for databases created in SQL Server 2005 or higher or on upgraded databases that have been corrected once by using DBCC UPDATEUSAGE. Because DBCC UPDATEUSAGE can take some time to run on large tables or databases, it should not be used only unless you suspect incorrect values are being returned by sp_spaceused.

    Consider running DBCC UPDATEUSAGE routinely (for example, weekly) only if the database undergoes frequent Data Definition Language (DDL) modifications, such as CREATE, ALTER, or DROP statements.

    I think that this is a standard process after upgrade.

    After upgrade from SQL 2000 or earlier (or even 2005 early service packs sometimes)

    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
  • Thanks. It helped a lot.

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

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