zoukankan      html  css  js  c++  java
  • ORA-02050故障诊断一例

    转http://www.cnblogs.com/svennee/p/4083359.html

    昨天客户反映说在下午某时间段有几个事务失败了,让我查下当时数据库系统的负载是否正常,看了下CPU的历史负载,很正常,于是看了下日志发现有几个timeout错误和一个ORA-02050错误。
    Tue Feb 15 20:44:05 2011
    Error 1013 trapped in 2PC on transaction 199.40.297416. Cleaning up.
    Tue Feb 15 20:44:56 2011
    Error stack returned to user:
    ORA-02050: transaction 199.40.297416 rolled back, some remote DBs may be in-doubt
    ORA-01013: user requested cancel of current operation 
    这个是分布式事务处理出错的提示,根据提示可知,可能是由于远程的数据库处理失败,导致事务号为199.40.297416的事务失败而回滚。原因可能是网络,也可能是远程节点的连接超时或是人为kill等。
    Oracle给出的解释是:
    Error: ORA 2050
    Text: transaction <num> rolled back, some remote DBs may be in-doubt
    -------------------------------------------------------------------------------
    Cause:There was a network failure or a remote failure during the two-phase commit.
    Action:Notify the database administrator.
    The remote databases will automatically resynchronize when the failure is repaired. 
    大致意思为:一种可能为网络失败,另外一种是事务在两个阶段commit时,远程节点操作不成功,这时,它会记在dba_2pc_pending 中,reco进程后续会自动尝试去继续完成这个事务。但如果能确定这个节点段时间内不能完成,可能就需要人工处理这个pending transaction了。
    查询数据字典dba_2pc_pending和dba_2pc_neighbors均无任何记录,说明事务已经自动被恢复了。
    附录:
    dba_2pc_pending describes distributed transactions awaiting recovery.
    dba_2pc_neighbors describes incoming and outgoing connections for pending transactions. 
    在我这个例子中,由于事务已经被自动恢复,所以无需人工干预,如果没有自动恢复的话,可以通过如下语句处理:
    强制提交或回滚:
    SQL>commit force '199.40.297416'; 

    SQL>rollback force '199.40.297416'; 
    如果事务的状态为collecting,则不需要commit/rollback force,可这样处理,如下:
    1、disable分布式恢复
    SQL>alter system disable distributed recovery; 
    2、purge in-doubt transaction entry
    SQL>exec dbms_transaction.purge_lost_db_entry('199.40.297416'); 
    3、最后enable分布式恢复
    SQL>alter system enable distributed recovery;

     可能原因2:

    The warning message about pending distributed transaction can be ignored, which due to the DBROA switchover from 

    host1 -> host2

  • 相关阅读:
    centos x86_64--------------------------------系统调用
    通过tracing技术来教授操作系统
    Cobra —— 可视化Python虚拟机 and 图解python
    ArcGIS Engine中空间参照(地理坐标)相关方法总结
    ArcGIS Engine检索要素集、要素类和要素
    C#打开SDE数据库的几种方式总结
    ArcSDE:C#创建SDE要素数据集
    ORA-01653 无法在表空间扩展的解决办法 -- 增加表空间大小或给表空间增加数据文件
    3.第一个Node.js程序:Hello World!
    2.使用的版本
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/6755595.html
Copyright © 2011-2022 走看看