Question

Ran into the following error...

K:\Microsoft SQL Server\Data\MyAudit3_Dat.NDF_MSSQL_DBCC50: Operating system error 112(There is not enough space on the disk.) encountered.

In this case the disk space was very low which needed remediation... However, it lead me to ponder what are the disk space requirements for dbcc checkdb?

Was it helpful?

Solution

CHECKDB need two types of storage while executing:

  1. Tempdb. This is to keep track of where it is (to simplify quite a bit). This is what Dominique refers to. However, this was not your problem (as we can see by the error message).

  2. On the same disk where each data file for the database resides. It creates one "CHECKDB working file" for each data file for your database. Since CHECKDB work with an internal snapshot database, it need to do copy-on-write. I.e., whenever a modification is done in your database, SQL Server need to first copy that extent (64 KB block) to a snapshot file. You can see the snapshot file in the error message - this is how we can deduce that the problem isn't with tempdb.

I.e., the more data you modify, the more storage is needed for the snapshot file. You don't want to have a checkdb running while you rebuild an index or do a large import, as a couple of examples. As you can imagine, we can't say how much space is needed since we don't know how much data modifications you do while checkdb is running.

So, check the timing for your jobs.

OTHER TIPS

It depends on the database size.

You can run

dbcc checkdb ('master') WITH ESTIMATEONLY

To get an estimation of the space requirement. Usually, this is not really accurate but I guess it's better then nothing.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top