ITPub博客

首页 > 数据库 > Oracle > ORA-02062: distributed recovery 引起的 ORA-02019: connection description for remote database not found

ORA-02062: distributed recovery 引起的 ORA-02019: connection description for remote database not found

原创 Oracle 作者:zhang41082 时间:2019-03-28 16:48:04 0 删除 编辑

一个测试数据库隔三差五的报一个ORA-02019出来,查找alert文件,有一个详细的trace:
*** 2007-10-12 21:47:55.083
ERROR, tran=2.34.74876, session#=1, ose=0:
ORA-02062: distributed recovery received DBID 78d96835, expected 2421f8a5
*** 2007-10-12 21:49:08.093
ERROR, tran=2.34.74876, session#=1, ose=0:
ORA-02019: connection description for remote database not found
看来这个ORA-02019只是表面现象,引起的原因应该是ORA-02062

[@more@]

网上搜索了下,找到了老和尚的解决办法,记录在此吧:
处理办法:

(1) set transaction use rollback segment system
(this is VERY important, otherwise database loss can occur)
(2) select * from dbc_2pc_pending where state='collecting';
(3) for each local_tran_id in selected rows, delete where local_tran_id is that value from the following tables:
dba_2pc_pending
pending_sessions$
pending_sub_sessions$

因为是817 undo是手工管理的,就不用进行第一步设置。如果是auto 管理undo 段的话

要先屏蔽掉对undo操作的错误提示:
sql>alter system set UNDO_SUPPRESS_ERRORS = TRUE
sql>EXECUTE DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('1.29.81672')
sql>alter system set UNDO_SUPPRESS_ERRORS = false

首先:

/****1.查找处于分布式事务状态下的本地事务ID号***/

select local_tran_id from dba_2pc_pending;

29.22.266482
8.36.982659
27.40.380788

/*****清楚这个分布式事务(该事务已经无法完成),不会对数据库有影响***/

SQL> EXECUTE DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('29.22.266482');

PL/SQL procedure successfully completed

SQL> commit;

PL/SQL procedure successfully completed


问题解决了,原因也就很容易找到了,是做一个大的通过dblink的两个db间的分布式事务的时候,修改了dblink的链接指向,导致了正在运行的事务找不到原先正确的dblink了,分布式事务卡在那里了。

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

请登录后发表评论 登录
全部评论

注册时间:2002-10-11

  • 博文量
    105
  • 访问量
    83561