user run a select statement on a local table but get "ora-01591:lock held by in-doubt distribted transaction 3.1.116925" error, somehow a developer update a record through database link to sybase but forgot to commit on oracle side. here is how to troubleshoot and resolve it.
1. find out the pending transactions.
in oracle 10g:
sqlplus > select * from dba_2pc_pending;
sqlplus > select * from DBA_2PC_NEIGHBORS;
record local_tran_id
(in oracle 9i
sqlplus > select * from sys.pending_trans$;
the query result shows the local_tran_id (3.1.116925), os_user (a developer name shows here) and a os_terminal (the developers pc name), fail time (recent) and state (prepared).
)
2. rollback the pending transaction, query the state again, the state is changed from prepared to "forced rollback"
sqlplus > rollback force '3.1.116925';
3. clear the records.
execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('3.1.116925')
commit;
now query the sys.pending_trans$ and DBA_2PC_NEIGHBORS, no record exists anymore!
1. find out the pending transactions.
in oracle 10g:
sqlplus > select * from dba_2pc_pending;
sqlplus > select * from DBA_2PC_NEIGHBORS;
record local_tran_id
(in oracle 9i
sqlplus > select * from sys.pending_trans$;
the query result shows the local_tran_id (3.1.116925), os_user (a developer name shows here) and a os_terminal (the developers pc name), fail time (recent) and state (prepared).
)
2. rollback the pending transaction, query the state again, the state is changed from prepared to "forced rollback"
sqlplus > rollback force '3.1.116925';
3. clear the records.
execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('3.1.116925')
commit;
now query the sys.pending_trans$ and DBA_2PC_NEIGHBORS, no record exists anymore!
Comments
Post a Comment