ITPub博客

首页 > 数据库 > Oracle > 分布事务挂死处理步骤

分布事务挂死处理步骤

原创 Oracle 作者:juan025 时间:2019-06-09 12:18:08 0 删除 编辑
分布事务挂死处理步骤
SELECT * FROM dba_2pc_pending WHERE local_tran_id='156.23.65856';

ROLLBACK/COMMIT FORCE '156.23.65856';
BEGIN DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('156.23.65856'); END;
执行上述清除事务报错ORA-06510: PL/SQL: UNHANDLED USER-DEFINED EXCEPTION ,按以下步骤处理
1、手工删除数据词典记录
DELETE FROM SYS.PENDING_TRANS$ WHERE LOCAL_TRAN_ID = '156.23.65856';
DELETE FROM SYS.PENDING_SESSIONS$ WHERE LOCAL_TRAN_ID = '156.23.65856';
DELETE FROM SYS.PENDING_SUB_SESSIONS$ WHERE LOCAL_TRAN_ID ='156.23.65856';
2、手工插入记录
INSERT INTO PENDING_TRANS$
(LOCAL_TRAN_ID,GLOBAL_TRAN_FMT,GLOBAL_ORACLE_ID,STATE,STATUS,SESSION_VECTOR,RECO_VECTOR,TYPE#,FAIL_TIME,RECO_TIME)
VALUES
('156.23.65856', /* <==Replace this with your local tran id */306206, 'XXXXXXX.12345.1.2.3', 'prepared',
'P', /*modification. Most of the values*/HEXTORAW('00000001'), /*constant.*/HEXTORAW('00000000'), 0,SYSDATE,SYSDATE);
INSERT INTO PENDING_SESSIONS$ VALUES
('156.23.65856', /* <==Replace only this with your local tran id */1,HEXTORAW('05004F003A1500000104'),'C',0,30258592,'',146);
3、提交pending 事务
COMMIT FORCE '156.23.65856' ;
4、清除事务 Purge the transaction:
BEGIN DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('156.23.65856'); END; 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/693533/viewspace-2072261/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2019-02-13

  • 博文量
    26
  • 访问量
    20475