Checking the files

After you locate the DBD in the dump, the files can be analyzed for inconsistencies.

Procedure

To check each file that is located by OBD:

  1. Cross-check the file OBD with the catalog. To do this task, issue the following SQL statements, replacing dbid with the DBID of the DBD being checked and obid with the OBID of the file that is being checked.

    Begin program-specific programming interface information.

    SELECT NAME, PSID FROM SYSIBM.SYSTABLESPACE
      WHERE DBID=dbid
      AND OBID=obid;

    End program-specific programming interface information.

    The result is one row, and the name and PSID matches the OBDFNAME and OBDFIPS, in OBDFILE.

    If the number of rows that are returned is not 1, or if the name and PSID do not match, make a note of the error.

  2. Check the data page set of the file OBD. Use the OBID contained in the OBDFIPS field to locate, check, and mark the data page set OBD (OBDPSET). The value for OBDTYPE is binary B'11'. To check the data page set OBD:
    • Determine whether the value of the OBDPSOB field matches the file OBID.
    • Cross-check the page set OBD with the catalog. Issue the following SQL statement, replacing obdfname with the value found in the OBDFNAME field of the file OBD, and replacing dbddbnam with the database name of the DBD being checked (that is, the value found in the DBDDBNAM field of the DBD header).

      Begin general-use programming interface information.

      SELECT COUNT(*) FROM SYSIBM.SYSTABLEPART
        WHERE TSNAME=obdfname
        AND DBNAME=dbddbnam;
      End general-use programming interface information.

      The result is 1 if the table space is a simple table space (that is, if OBDPSANM equals 0). If the table space is partitioned, the result is equal to the value of OBDPSANM (in OBDPS).

  3. Check the OBD record chain within the file. The OBDFIREC field in the OBDFILE contains the OBID of the first record OBD (OBDREC). The OBDREREC field in OBDREC contains either a 0 or the OBID of the next record OBD. A 0 in OBDREREC indicates that it is the last record OBD.

    Check the record chain for the file. Mark each record OBD (indicated by an OBDTYPE field that equals binary B'01') in the record chain. Perform the check that is described under Checking the records.

    If the record chain is damaged (that is, the OBD located is not a record OBD), make a note of the error.

  4. Return to the procedure that referred you here.