Oracle9i Supplied PL/SQL Packages and Types Reference
Release 1 (9.0.1)

Part Number A89852-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

DBMS_TRANSACTION , 17 of 19


PURGE_LOST_DB_ENTRY Procedure

When a failure occurs during commit processing, automatic recovery consistently resolves the results at all sites involved in the transaction. However, if the remote database is destroyed or recreated before recovery completes, then the entries used to control recovery in DBA_2PC_PENDING and associated tables are never removed, and recovery will periodically retry. Procedure PURGE_LOST_DB_ENTRY enables removal of such transactions from the local site.

Syntax

DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY (
   xid VARCHAR2);


WARNING:

PURGE_LOST_DB_ENTRY should only be used when the other database is lost or has been recreated. Any other use may leave the other database in an unrecoverable or inconsistent state. 


Before automatic recovery runs, the transaction may show up in DBA_2PC_PENDING as state "collecting", "committed", or "prepared". If the DBA has forced an in-doubt transaction to have a particular result by using "commit force" or "rollback force", then states "forced commit" or "forced rollback" may also appear. Automatic recovery normally deletes entries in any of these states. The only exception is when recovery finds a forced transaction which is in a state inconsistent with other sites in the transaction; in this case, the entry is left in the table and the MIXED column has the value 'yes'.

However, under certain conditions, it may not be possible for automatic recovery to run. For example, a remote database may have been permanently lost. Even if it is recreated, it gets a new database ID, so that recovery cannot identify it (a possible symptom is ORA-02062). In this case, the DBA may use the procedure PURGE_LOST_DB_ENTRY to clean up the entries in any state other than "prepared". The DBA does not need to be in any particular hurry to resolve these entries, because they are not holding any database resources.

The following table indicates what the various states indicate about the transaction and what the DBA actions should be:

Table 65-10 PURGE_LOST_DB_ENTRY Procedure States
State of Column   State of Global Transaction  State of Local Transaction  Normal DBA Action  Alternative DBA Action 
Collecting
 

Rolled back 

Rolled back 

None 

PURGE_LOST_DB_ENTRY (See Note 1) 

Committed
 

Committed 

Committed 

None 

PURGE_LOST_DB_ENTRY (See Note 1) 

Prepared
 

Unknown 

Prepared 

None 

FORCE COMMIT or ROLLBACK 

Forced commit
 

Unknown 

Committed 

None 

PURGE_LOST_DB_ENTRY (See Note 1) 

Forced 
rollback
 

Unknown 

Rolled back 

None 

PURGE_LOST_DB_ENTRY (See Note 1) 

Forced commit  
(mixed)
 

Mixed 

Committed 

(See Note 2) 

 

Forced 
rollback 
(mixed) 
 

Mixed 

Rolled back  

(See Note 2) 

 


NOTE 1:

Use only if significant reconfiguration has occurred so that automatic recovery cannot resolve the transaction. Examples are total loss of the remote database, reconfiguration in software resulting in loss of two-phase commit capability, or loss of information from an external transaction coordinator such as a TP monitor. 



NOTE 2:

Examine and take any manual action to remove inconsistencies; then use the procedure PURGE_MIXED


Parameters

Table 65-11 PURGE_LOST_DB_ENTRY Procedure Parameters
Parameter  Description 
xid
 

Must be set to the value of the LOCAL_TRAN_ID column in the DBA_2PC_PENDING table. 


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback