sp_dbcc_exclusions

Description

Allows the user to create and manage persistent exclusion lists for use by checkverify and sp_dbcc_faultreport.

Syntax

sp_dbcc_exclusions dbname, op, type, exclusion_list

Parameters

dbname

is the name of the database for which the exclusions apply, or null if it applies to all databases.

op

is the operation you want to perform. Valid values are:

  • add – registers new exclusions (duplicates are ignored).

  • drop – drops the specified exclusions if they were previously registered

  • listall – lists the recorded exclusions for all databases.

type

is the type of item to be excluded. Accepted values are faults, tables, combo, or null (when op is either null or listall). Type, varchar.

exlusion_list

is a comma-separated list of faults, tables, table and fault entries, or nulls. Type, varchar.

Examples

Example 1

Excludes the tables syslogs and syscomments from sp_dbcc_faultreport processing on all databases:

sp_dbcc_exclusions null, 'add', 'tables', 'syslogs,
    syscomments'

Example 2

Excludes fault type 100036 from processing of the database my_db:

sp_dbcc_exclusions my_db, 'add', 'faults', '100036'

Example 3

Adds the following to the exclusion list corresponding to my_db: fault type 100002 pertaining to table mytable and fault type 100035 pertaining to syslogs:

sp_dbcc_exclusions my_db, 'add', 'combo', ‘mytable:100002, syslogs:100035’

Example 4

Removes fault type 100036 from the exclusion list corresponding to my_db:

sp_dbcc_exclusions my_db, 'drop', 'faults', '100036'

Example 5

Displays the exclusion list corresponding to my_db:

sp_dbcc_exclusions my_db

Example 6

Displays the recorded exclusions for all databases:

sp_dbcc_exclusions null, 'listall'

Usage

Permissions

The permission checks for sp_dbcc_exclusions differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be the database owner of dbccdb (or dbccalt), or have the manage checkstorage privilege on the specified database.

Granular permissions disabled

With granular permissions disabled, you must be a user with sa_role.