9-56 IBM Informix OnLine Database Server Administrator’s Guide
Determining Database Consistency
DATABASE tmp;
BEGIN WORK;
INSERT INTO t VALUES (2);
INSERT INTO tmp@apex:t VALUES (2);
COMMIT WORK;
### return code -698
The following excerpt is taken from the logical log at the current database
server:
.....
17018 16 CKPOINT 0 0 13018 0
18018 20 BEGIN 2 1 0 08/27/91 10:56:57 3482 pault
1802c 32 HINSERT 2 0 18018 1000018 102 4
1804c 40 CKPOINT 0 0 17018 1
begin xid ID addr user
1 2 1 1802c pault
19018 72 BEGPREP 2 0 1802c 6d69 1
19060 16 COMMIT 2 0 19018 08/27/91 11:01:38
1a018 16 ENDTRANS 2 0 19060 580543
....
The following excerpt is taken from the logical log at the OnLine database
serverapex:
16018 20 BEGIN 2 1 0 08/27/91 10:57:07 3483 pault
1602c 32 HINSERT 2 0 16018 1000018 102 4
1604c 68 PREPARE 2 0 1602c eh
17018 16 HEURTX 2 0 1604c 1
17028 12 CLR 2 0 1602c
17034 16 ROLLBACK 2 0 17018 08/27/91 11:01:22
17044 40 CKPOINT 0 0 15018 1
begin xid ID addr user
1 2 1 17034 --------
18018 16 ENDTRANS 2 0 17034 8806c3
....
First,you would try to match the transactions in the current database server
log with the transactions in theapex database server log as follows: The
BEGPREP and PREPARE log records each contain the global transaction
identifier(GTRID). You can extract the GTRID by using tblog -l and looking at
thefirst 68 bytes of the data portion of the BEGPREP and PREPARE log records.
Thisis the GTRID. A more simple, though less precise, approach is to look at
the time of the COMMIT orROLLBACK records. The times should be close,
although there is a slight delay because of the time taken to transmit the
commit (or rollback) message from the coordinator to the participant. (This
second approach lacks precision because concurrent transactions could
commit at the same time, although the probability is low that concurrent
transactions from one coordinator would commit at the same time.)
To correct this example situation, you would take the following steps: