Checking data consistency with the CHECK utilities

One way to check data consistency is to use the CHECK DATA, CHECK INDEX, and CHECK LOB online utilities. You might want to use these utilities when you do a conditional restart or a point-in-time recovery or repair data.

Before you begin

Before you run CHECK DATA or CHECK LOB, you can find out all of the related tables spaces by using the REPORT utility with the TABLESPACESET option.

Procedure

To check data consistency with the CHECK utilities:

Run one of the following utilities as needed:
CHECK DATA
The CHECK DATA utility checks referential constraints (but not informational referential constraints). It determines whether each foreign key value in each row is a value of the primary key in the appropriate parent table.

The CHECK DATA utility also checks table check constraints and checks the consistency between a base table space and any associated LOB or XML table spaces. It determines whether each value in a row is within the range that was specified for that column when the table was created.

The CHECK DATA utility also performs consistency checks on XML table spaces and related NodeID indexes. It verifies the consistency of XML documents that are stored in an XML table space and validates the documents against one or more XML schemas that are specified in the XML type modifier.

CHECK INDEX
The CHECK INDEX utility checks the consistency of indexes with the data to which the indexes point. It determines whether each index pointer points to a data row with the same value as the index key. If an index key points to a LOB, the CHECK INDEX utility determines whether the index key points to the correct LOB. If an index key points to an XML, the CHECK INDEX utility determines whether the index key points to the correct XML.
CHECK LOB
The CHECK LOB utility checks the consistency of a LOB table space. It determines whether any LOBs in the LOB table space are invalid.