DBCC CHECKDB


Job details

Name: DBCC CHECKDB
Platform: Sqlserver
Category: Maintenance
Premium package: Maintenance package
Description: Checks the logical and physical integrity of all the objects in all databases by performing the DBCC CHECKDB operation.
Long description: By default only ONLINE databases with the following properties are included: UserAccess = MULTI_USER, Updateability = READ_WRITE, IsInStandBy = 0, IsMergePublished = 0, IsPublished = 0 and IsSubscribed = 0.
Version: 2.64
Default schedule: 15 4 6 *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2005′ & hasengine=‘YES’]/.[eng_inst_priv = 0 & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
PHYSICAL_ONLY YES If set to YES (default) limits the checking to the integrity of the physical structure of the page and record headers and the allocation consistency of the database. This check is designed to provide a small overhead check of the physical consistency of the database, but it can also detect torn pages, checksum failures, and common hardware failures that can compromise a users data.
ignore databases List of databases (separated by comma) which will be ignored. You can use % (percent sign) to represent wild card characters.
disable during working hours YES This parameter disables the alert to be scheduled, or to be run manually, during working hours (between 7am and 5pm).
max elap time 180 The maximum number of minutes before the dbWatch task stops running DBCC CHECKDB command for the remaining databases.
continue on next run YES If set to “YES“ (default) the DBCC CHECKDB command will continue where it left off.
include READ ONLY databases NO If set to “YES“ all databases with updateability property value “READ_ONLY“ will be included when performing the DBCC CHECKDB operation.
include Stand-by databases NO If set to “YES“ all databases with “IsInStandBy” property value “1″ will be included when performing the DBCC CHECKDB operation.
include Published databases NO If set to “YES“ all databases with “IsMergePublished” and “IsPublished “properties values “1″ will be included when performing the DBCC CHECKDB operation.
include Subscribed databases NO If set to “YES“ all databases with “IsSubscribed” property value “1″ will be included when performing the DBCC CHECKDB operation.
return status 2 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when the DBCC CHECKDB procedure returns errors from one or more databases.
ignore errors 1205 List of error numbers (separated by comma) which will be ignored.
return status when exception 1 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when an exception occurs during the execution of DBCC CHECKDB.
return status when terminated abnormally 2 This parameter defines the return status (ALARM – 2, WARNING – 1, or OK – 0) when the dbWatch main procedure terminates unexpectedly. An abnormal termination refers to errors with a severity level of 20 or higher, which can cause the entire procedure to terminate without entering the CATCH block. In such cases, the dbWatch job will only return information that it was terminated uncontrollably, without any details about the DBCC execution. Upon the next successful execution of the procedure, it will provide feedback on which database caused the issue.
keep WARNING/ALARM status 48 The duration (in hours) for which the job will retain a WARNING or ALARM status following the occurrence of such an event.

Job Summary

DBCC CHECKDB(<database_name>)

Job Details

Advanced Job Configuration

Dependency Model

The job relies on several internal and historical tables and procedures for executing the checks and recording the results:

Execution and Error Handling

Impact and Importance