Sql-server – Running CheckDB on a clone

dbcc-checkdbmaintenancesql-server-2012

My company are looking to bring in Redgate's SQL Clone to deploy live databases into other environments. I wanted to see if running CheckDB on these clones was a viable option instead of restoring a database to a non production environment or running checkdb in production.

Best Answer

I am not 100% sure of the technology they use but their documentation speaks of virtual disk files. I have recently implemented a similar home grown solution using virtual disk files to store restores of databases as images with differencing disks hosting the clone databases. Any write action will go to the differencing disk but reads, unless to an updated page, will go to the base image virtual disk.

Any DBCC commands run against a clone will read from the base image virtual disk file. So, in theory DBCC checks against a clone should be as valid as restoring to a non production environment.

Assuming that data corruption will be backed up and restored, it should be a valid check of production.

Running DBCC checks used to be important when storage hardware was less reliable. The need for them is reduced with more modern storage technology. That is not to say that you should not run them, you really should! Just less often. In previous employment we reduced our DBCC checks to monthly or less. Although, we did have a considerable amount of databases and the IO requirement to peform the checks meant we our hands were forced to reduce the frequency.