Sunday, 20 May 2012

ORA-2050 resolution

Error :
ORA-02050: transaction 4.55.150856 rolled back, some remote DBs may be in-doubt
ORA-02051: another session or branch in same transaction failed or finalized
Tue Mar 20 11:21:32 2012

Reason :
For some reason, the distributed transaction did not finish properly,
it ended with "collecting" status. The reco process tried to recover
the transaction periodicly but failed, thus error logged into alert log
and trace file. The best way to clean it is using above command.
=========================================================
Before you begin, make note of the local transaction ID, <local_tran_id>, from
the error message reported.
1. Determine if you can attempt a commit or rollback of this
transaction. You can do the following select to help determine what
action to take:
SQL> select state, tran_comment, advice from dba_2pc_pending
where local_tran_id = '4.55.150856';
Review the TRAN_COMMENT column as this could give more information
as to the origin of the transaction or what type of transaction it was.
Review the ADVICE column as well. Many applications prescribe advice
about whether to force commit or force rollback the distributed
transaction upon failure.
2. Commit or rollback the transaction.
To commit:
SQL> commit force '<local_tran_id>';
To rollback:
SQL> rollback force '<local_tran_id>';

No comments:

Post a Comment