Identifying Db2 data inconsistency problems

Data inconsistency problems occur for various reasons, including internal Db2 problems, I/O errors, or system problems.

About this task

Data inconsistency problems can occur as a result of referential integrity constraint violations. Referential integrity describes the condition where all references to data in pages are valid. Db2 provides referential integrity by enforcing referential constraints on the data. Referential integrity constraint violations do not cause abends because Db2 does not depend on referential constraints to operate. Referential constraint violations do, however, cause incorrect results in processing.

Data inconsistency problems fall into one or more of the following categories:

  • Unavailable data
  • Internal inconsistency
  • Inconsistent page
  • Inconsistent page set.

These conditions can exist singly or in combination. They are evidenced by various symptoms, and can be identified by a number of messages and codes. Discovering an inconsistency in user or Db2 system data can be difficult, depending upon the complexity of the problem.

Procedure

To identify Db2 data inconsistency problems:

  1. Identify the database dbname and table space tsname that contain the inconsistent data.
  2. Enter -START DATABASE(dbname) ACCESS(RO) to limit access to the data before an attempt is made to resolve the inconsistency.
    This action prevents subsequent updates to the inconsistent data from compounding the problem.

    Inhibiting updates to the inconsistent data is particularly important if the Db2 catalog or directory is involved in the problem. If catalog or directory problems are suspected, issue -START DATABASE(DSNDB06) ACCESS(RO) to inhibit DDL, GRANT, REVOKE, and BIND activities.

  3. Determine how to resolve the problem by following the guidelines in Data inconsistency symptoms and actions or the detailed procedures in Inconsistency resolution with RECOVER TABLESPACE and RECOVER INDEX or Resolving inconsistencies manually.
  4. Enter -START DATABASE(dbname) SPACENAM(tsname) ACCESS(UT) to allow utility processing.
  5. Invoke either RECOVER or REPAIR (depending on what the information in Table 1 suggests).
  6. Determine whether the damage is corrected.
  7. After the data is made consistent, issue -START DATABASE(db) SPACENAM(ts) ACCESS(RW) to restore full access to the data.