重庆思庄Oracle、Redhat认证学习论坛

标题: Error 3113 trapped in 2PC on transaction xxx. Cleaning up. 错误分析处理 [打印本页]

作者: jiawang    时间: 2020-7-2 19:24
标题: Error 3113 trapped in 2PC on transaction xxx. Cleaning up. 错误分析处理
本帖最后由 jiawang 于 2020-7-3 16:50 编辑

一、报错现象:
Mon May 25 19:22:09 2020
Error 3135 trapped in 2PCon transaction 18.7.783271. Cleaning up.
Error stack returned touser:
ORA-02050: transaction18.7.783271 rolled back, some remote DBs may be in-doubt
ORA-03135: connection lostcontact
ORA-02063: preceding linefrom BAXT

二、分析
此类问题通常是由于网络问题或远程数据库异常导致的分布式事务失败。
执行下面SQL语句  
select LOCAL_TRAN_ID,GLOBAL_TRAN_ID,STATE,MIXED,HOST,COMMIT# from dba_2pc_pending;
#dba_2pc_pending视图记录等待恢复的分布式事务的信息
select * from DBA_2PC_NEIGHBORS;
#视图记录未决的分布式事务的输入输出连接信息


三、处理
1.如果在上述视图中查询到记录,则尝试force commit/rollback
commit force '644.3.881743';

2.如果不成功则进行如下操作
(1).Disable分布式恢复
SQL> ALTER SYSTEM DISABLE DISTRIBUTED RECOVERY;System altered.

(2).Puege(清空)in-doubt transaction entry:
SQL> exec DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('644.3.881743');
PL/SQL procedure successfully completed.

(3).然后enable 分布式恢复:
SQL> ALTER SYSTEM ENABLE DISTRIBUTED RECOVERY;






欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2