Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Steps to Purge a Distributed Transaction from a Database. (ORA-24756: transaction does not exist tips)

$
0
0




Please follow the below steps.






If the remote database cannot be accessed, a failed distributed transaction cannot be committed or rolled back and so must be purged from the list of pending transactions.




For ex. the error we will get in alert log as ORA-24756: transaction does not exist 







1. Identify the id of the transaction:


SQL> column global_tran_id format a25
SQL> column database format a22
SQL> column global_name format a22
SQL> SELECT * from global_name;
SQL> SELECT LOCAL_TRAN_ID, GLOBAL_TRAN_ID,to_char(FAIL_TIME,'dd-mon-yyyy HH24:MI:SS'),STATE, MIXED FROM DBA_2PC_PENDING;
SQL> SELECT LOCAL_TRAN_ID, IN_OUT,INTERFACE, DATABASE FROM DBA_2PC_NEIGHBORS;




2. Purge the transaction:



SQL> EXECUTE DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('<transaction_id>');
SQL> COMMIT;




3. Confirm that the transaction has been purged:



SQL> SELECT LOCAL_TRAN_ID, GLOBAL_TRAN_ID,to_char(FAIL_TIME,'dd-mon-yyyy HH24:MI:SS'),STATE, MIXED FROM DBA_2PC_PENDING;



SQL> SELECT LOCAL_TRAN_ID, IN_OUT,INTERFACE, DATABASE FROM DBA_2PC_NEIGHBORS;





While trying to purge the transactions, if you hit error ORA-06510 as shown below :

======================================================



BEGIN DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('9.32.558'); END;

*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.DBMS_TRANSACTION", line 96
ORA-06512: at line 1



you can run the below command to get rid of them.

SQL> rollback force '9.32.558';







Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>