Running DBCCs

Use the following endpoint to run database consistency checks:

  • POST /systemtools/v1/batch-processes/{batchProcessType}/start

The value of {batchProcessType} must be: DBConsistencyCheck.

Running all DBCCs

To run all DBCCs, execute the request with no request body. PolicyCenter runs all DBCCs on all tables for all check types.

The following request runs all DBCCs.

POST /systemtools/v1/batch-processes/DBConsistencyCheck/start

<no request body>
Java

Running DBCCs for a specific set of tables

To limit a DBCC run to a single set of tables, you must include a request body. The body must contain a dbconsistencycheck property with a tableNames array that names the tables.

For example, the following request runs all DBCCs for the cc_activity and cc_address tables.

POST /systemtools/v1/batch-processes/DBConsistencyCheck/start

{
  "data": {
    "attributes": {
      "dbconsistencycheck": {
        "tableNames": [
          "cc_activity",
          "cc_address"
        ]
      }
    }
  }
}
Java

Note that PolicyCenter does not perform any validation to ensure that there are tables in the database with the specified names. If there is no table corresponding to a provided table name, PolicyCenter ignores the name.

Running DBCCs for a specific set of check types

To limit a DBCC run to a single set of check types, you must include a request body. The body must contain a dbconsistencycheck property with a checkTypes array that names the check types.

For example, the following request runs all DBCCs whose check type is either 0lengthstringcheck or assignmentcheck.

POST /systemtools/v1/batch-processes/DBConsistencyCheck/start

{
  "data": {
    "attributes": {
      "dbconsistencycheck": {
        "checkTypes": [
          "0lengthstringcheck",
          "assignmentcheck"
        ]
      }
    }
  }
}
Java

Note that PolicyCenter does not perform any validation to ensure that there are check types in the data model with the specified names. If there is no check type corresponding to provided check type name, PolicyCenter ignores the name.

Adding a custom description to a DBCC run

Every DBCC has an automatically generated description that specifies which tables and checks were executed in the DBCC.

You can optionally add a custom description to a DBCC run. To do this, you must include a request body. The body must contain a description property. PolicyCenter prepends the user-provided description to its own generated description.

For example, the following request runs all DBCCs with a description of "Start of Q1 maintenance".

POST /systemtools/v1/batch-processes/DBConsistencyCheck/start

{
  "data": {
    "attributes": {
      "dbconsistencycheck": {
        "description": "Start of Q1 maintenance"
      }
    }
  }
}
Java

The description stored in the database is:

"description": "Start of Q1 maintenance; Tables:  All.; Checks:  All.",
Java

Combining Run DBCC criteria

You can combine multiple DBCC criteria in a single call.

For example, the following request runs all DBCCs for the cc_activity and cc_address tables whose check type is either 0lengthstringcheck or assignmentcheck, and it adds a custom description of "Start of Q1 maintenance".

POST /systemtools/v1/batch-processes/DBConsistencyCheck/start

{
  "data": {
    "attributes": {
      "dbconsistencycheck": {
        "tableNames": [
          "cc_activity",
          "cc_address"
        ],
        " checkTypes ": [
          "0lengthstringcheck",
          "assignmentcheck"
        ],
        "description": "Start of Q1 maintenance"
      }
    }
  }
}
Java