|
 |
|
Commit Processing SQL Net
Oracle Tips by Burleson Consulting
|
|
The Data Warehouse Development Life Cycle
Managing Two-Phase Commits (2PCs) With SQL*Net
When a distributed update (or delete) has finished processing,
SQL*Net will coordinate COMMIT processing, which means that the
entire transaction will roll back if any portion of the transaction
fails. The first phase of this process is a prepare phase to each
node, followed by the COMMIT, and then terminated by a forget phase.
If a distributed update is in the process of issuing the 2PC and a
network connection breaks, Oracle will place an entry in the
Remote DBA_2PC_PENDING table. The recovery background process (RECO) will
then roll back or commit the good node to match the state of the
disconnected node to ensure consistency. You can activate RECO via
the ALTER SYSTEM ENABLE DISTRIBUTED RECOVERY command.
The Remote DBA_2PC_PENDING table contains an ADVISE column that directs the
database to either commit or roll back the pending item. You can use
the ALTER SESSION ADVISE syntax to direct the 2PC mechanism. For
example, to force the completion of an INSERT, you could enter the
following:
ALTER SESSION ADVISE COMMIT;
INSERT INTO PAYROLL@LONDON . . . ;
When a 2PC transaction fails, you can query the Remote DBA_2PC_PENDING
table to check the STATE column. You can enter SQL*Remote DBA and use the
Recover In-Doubt Transaction dialog box to force either a roll back
or a commit of the pending transaction. If you do this, the row will
disappear from Remote DBA_P2C_PENDING after the transaction has been
resolved. If you force the transaction the wrong way (for example,
roll back when other nodes committed), RECO will detect the problem,
set the MIXED column to yes, and the row will remain in the
Remote DBA_2PC_PENDING table.
This is an excerpt from "High Performance
Data Warehousing", copyright 1997.
 |
If you
like Oracle tuning, you may enjoy the book
Oracle Tuning: The Definitive Reference , with
over 900 pages of BC's favorite tuning tips &
scripts.
You can buy it
directly from the publisher and save 30%, and get
instant access to the code depot of Oracle tuning
scripts. |
|
|