DBCC CHECKDB Basics
Checks the logical and physical integrity of all the objects in the specified database by performing the following operations:
Running DBCC CHECKDB
Always run CHECKDB with NO_INFOMSGS,
If you run CHECKDB without this you will get a wall of informational messages.
DBCC CHECKDB (Blog) WITH NO_INFOMSGS
To run CHECKDB against a database you can either run
DBCC CHECKDB () if you are in the context of the database you want to run against (ie
USE [MyDB] GO DBCC CHECKDB () WITH NO_INFOMSGS
Or via naming the database within the DBCC command
DBCC CHECKDB (MyDB) WITH NO_INFOMSGS
DBCC CheckDB is a resource intensive action. (It checks every page on disk so I/O will be high, but it is also very memory and CPU heavy)
DBCC CHECKDB does not cause blocking locks since SQL Server 2000
If the CHECKDB is ran on Enterprise edition it will run with Parallelism. (This can be good or bad, check each case. It’s possible to turn off with Trace Flag 2528)
You can monitor DBCC CHECKING progress via
You can read the “last known good” to see the last time CHECKDB was ran successfully.
DBCC TRACEON (3604); DBCC DBINFO (Blog) GO
The results will show a lot of text, Scroll down to:
Results will look like below (Note the database I ran it against has never had CHECKDB Ran agaisnt it! You should never see this date in production!!!
Note – Read Erins blog to see that more than just CHECKDB updates this (
DBCC CHECKFILEGROUP, DBCC CHECKDB WITH PJYSICAL_ONLY will as well)
DBCC CHECKDB runs each of the below DBCC Commands.