Obtaining information from the logical log

About this task

To determine if data integrity has been affected by an inconsistently implemented global transaction, you must reconstruct the global transaction and determine which parts of the transaction were committed and which were rolled back. Use the onlog utility to obtain the necessary information. The procedure is as follows:

Procedure

  1. Reconstruct the transaction at the participant that contains the HEURTX record.
    1. A participant database server logical log is the starting point for your information search. Each record in the log has a local transaction identification number (xid). Obtain the xid of the HEURTX record.
    2. Use the local xid to locate all associated log records that rolled back as part of this piece of work.
  2. Determine which database server acted as coordinator for the global transaction.
    1. Look for the PREPARE record on the participant that contains the same local xid. The PREPARE record marks the start of the two-phase commit protocol for the participant.
    2. Use the onlog -l option to obtain the long output of the PREPARE record.
      This record contains the global transaction identifier (GTRID) and the name of the coordinating database server. For information about GTRID, see Obtain the global transaction identifier.
  3. Obtain a list of the other participants from the coordinator log.
    1. Examine the log records on the coordinator database server. Find the BEGPREP record.
    2. Examine the long output for the BEGPREP record.
      If the first 32 bytes of the GTRID in this record match the GTRID of the participant, the BEGPREP record is part of the same global transaction. Note the participants displayed in the ASCII part of the BEGPREP long output.
  4. Reconstruct the transaction at each participant.
    1. At each participant database server, read the logical log to find the PREPARE record that contains the GTRID associated with this transaction and obtain the local xid for the piece of work performed by this participant.
    2. At each participant database server, use the local xid to locate all logical-log records associated with this transaction (committed or rolled back).

Results

After you follow this procedure, you know what all the participants for the transaction were, which pieces of work were assigned to each participant, and whether each piece of work was rolled back or committed. From this information, you can determine if the independent action affected data integrity.