Thursday , October 31 2024

How Long Will CHECKDB Take to Run

 

The answer to this question depends on the size of the database that you are running this command, the parameters you will use with DBCC CHECKDB (such as NOINDEX, REPAIR_FAST) and your hardware resources.

However, if you have previously run a SQL Agent Job, you can find out how long it takes from Job’s History.

But what I want to share is that you can see how long it takes to run a DBCC CHECKDB with a DMV.(sys.dm_exec_requests)

After running the DBCC CHECKDB command, you can run the following command in another Query Editor window and look at the values in the “start_time” and “percent_complete” fields and calculate the approximate time for the process to be completed.

The “percent_complete” field on the sys.dm_exec_requests DMV will tell you how much of the processes have been completed in all of the following commands.

  • ALTER INDEX REORGANIZE
  • AUTO_SHRINK option with ALTER DATABASE
  • BACKUP DATABASE
  • DBCC CHECKDB
  • DBCC CHECKFILEGROUP
  • DBCC CHECKTABLE
  • DBCC INDEXDEFRAG
  • DBCC SHRINKDATABASE
  • DBCC SHRINKFILE
  • RECOVERY
  • RESTORE DATABASE,
  • ROLLBACK
  • TDE ENCRYPTION

Loading

About Ekrem Önsoy

The original article was written in Turkish by Ekrem Önsoy and translated to English by dbtut with the consent of the author. The copyright of the article belongs to the author. The author shall not be liable in any way for any defect caused by translation.

One comment

  1. Thanks, Ekrem! I had no clue how long the checkdb would last. At least I can tell all stakeholders when we expect to be back live.

Leave a Reply

Your email address will not be published. Required fields are marked *