I hate the situation where I have started a DBCC CHECKDB and I don’t know for how long time it has been running. Well, I have created this very small T-SQL statement that you can run.
select session_id, command, percent_complete
Session_ID is the session that has started the dbcc command. The result looks like the picture below.
Execute it continuously and see that percent_complete will grow.
It is important to know that DBCC CHECKDB executes three statements:
- DBCC CHECKALLOC
- DBCC CHECKTABLE
- DBCC CHECKATALOG
So actually the percentage will have to go to 100% three times. When the line disappears, then it is finished.
One other thing to note is that DBCC is using space, and to see how much space is required to run a dbcc CHECKDB, then simply write
dbcc checkdb(‘adventureworks2012’) with Estimateonly
Change adventure works to your database. On my server, the result is:
In my case DBCC CHECKDB requires 336 KB in TEMPDB.