Product Environment 9-55
Determining Database Consistency
You can also use the information in theHEURTX log record to locate all log
records (atall participating OnLine database servers) associated with the
global transaction of which this local transaction is just a piece. The steps
involved are asfollows:
1. Obtain the local xid from theHEURTX log record at a participant
OnLine where the transaction rolled back.
2. Lookfor a PREPARE log record for that local xid and obtain the global
transaction number (GTRID) and the name of the coordinating
OnLine.(Refer to page 9-58 for more information about the GTRID.)
3. Examine the logical log maintained by the coordinator OnLine and
locate theBEGPREP record for this global transaction.
4. Read theBEGPREP log record and obtain the coordinator’s local xid
for the transaction.
5. Readthe long listing of the BEGPREP record to obtain a list of all other
participants.
6. Ateach participant OnLine, read the logical log to find the PREPARE
record that contains theGTRID associated with this transaction and
obtain the local xid for the piece of work performed by this
participant.
7. Ateach participant OnLine, use the local xid to locate all logical log
records associated with this transaction (committed or rolled back).
8. Use the records you find and your knowledge of the application to
helpyou construct a compensating transaction that either rolls back
the committed effects of the transaction or commits the pieces of
work that were rolled back.
Example Manual Recovery
This example is intended to illustrate the kind of work that is involved in
manualrecovery.The following SQL statements were executed by user pault.
Error -698 was returned.
<prompt> dbaccess
CREATE DATABASE tmp WITH LOG;
CREATE TABLE t ( a int);
CLOSE DATABASE;
CREATE DATABASE tmp@apex WITH LOG;
CREATE TABLE t ( a int);
CLOSE DATABASE;