IMPORTANT: We HIGHLY recommend using Minion.CheckDBMaster for all of your integrity check operations, even when operating on a single table. Do not call Minion.CheckDBCheckTable to perform integrity checks.
The Minion.CheckDBMaster procedure makes all the decisions on which databases and tables to process, and what order they should be in. It’s certainly possible to call Minion.CheckDBCheckTable manually, to process an individual table, but we instead recommend using the Minion.CheckDBMaster procedure (and just include the single table using the @Tables parameter). First, it unifies your code, and therefore minimizes your effort. By calling the same procedure every time you reduce your learning curve and cut down on mistakes. Second, future functionality may move to the Minion.CheckDBMaster procedure; if you get used to using Minion.CheckDBMaster now, then things will always work as intended.
Name | Type | Description |
---|---|---|
@DBName | nvarchar |
Database name. |
@Schemas | varchar |
Limits maintennce to just a single schema, or list of schemas.
See the @Schema entry for Minion.CheckDBMaster for more information. |
@Tables | varchar |
Limits maintennce to just a single table, or list of tables. |
@StmtOnly | bit |
Only generate CheckDB statements, instead of running them. |
@PrepOnly | bit |
Only determines which tables require CheckTable at this time, and saves this information to a table (Minion.CheckDBCheckTableThreadQueue).
This feature is used automatically (and internally) for use multi-threaded CheckTable work.
Note: This can also be used by users. For example, if you wanted to edit the Minion.CheckDBCheckTableThreadQueue table after the list off tables was added to it, but before the actual CheckTable run. |
@RunPrepped | bit |
If you've run Minion.CheckDBCheckTable with @PrepOnly=1 (and so the list of tables to be checked is already in the Minion. Minion.CheckDBCheckTableThreadQueue table), then you can use this option to actually run CheckTable operations.
This feature is used automatically (and internally) for use multi-threaded CheckTable work.
Note: This can also be used by users. See the “Note” in the @PrepOnly entry above. |
@ExecutionDateTime | datetime |
Date and time the CheckTable took place.
If this stored procedure was called by Minion.CheckDBMaster, @ExecutionDateTime will be passed in here, so this operation is included as part of the entire (multi-table or multi-database) CheckTable operation. |
@Thread | tinyint |
For internal use only. |
@Debug | bit |
Enable logging of special data to the debug tables.
For more information, see “Minion.CheckDBDebug”, “Minion.CheckDBDebugSnapshotCreate”, and “Minion.CheckDBDebugSnapshotThreads”. |
Example Execution 1
-- Generate DBCC CHECKTABLE statements for database DB2, as applicable: EXEC [Minion].[CheckDBCheckTable] @DBName = 'DB2', @StmtOnly = 1;
Example Execution 2
-- Generate DBCC CHECKTABLE statements for database DB1: EXEC [Minion].[CheckDBCheckTable] @DBName = 'DB1', @StmtOnly = 1;