IBM 000-8697 Manual Do Utilizador

Página de 702
Product Environment
9-55
Determining Database Consistency
You can also use the information in the
HEURTX
 log record to locate all log
records (at all participating OnLine database servers) associated with the
global transaction of which this local transaction is just a piece. The steps
involved are as follows:
1.
Obtain the local xid from the
HEURTX
 log record at a participant
OnLine where the transaction rolled back.
2.
Look for a
PREPARE
log record for that local xid and obtain the global
transaction number (
GTRID
) and the name of the coordinating
OnLine. (Refer to
for more information about the GTRID.)
3.
Examine the logical log maintained by the coordinator OnLine and
locate the
BEGPREP
 record for this global transaction.
4.
Read the
BEGPREP
 log record and obtain the coordinator’s local xid
for the transaction.
5.
Read the long listing of the
BEGPREP
record to obtain a list of all other
participants.
6.
At each participant OnLine, 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.
7.
At each 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
help you 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
manual recovery. 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;