ORA-01591:lock held by in-doubt distributed transacation 解析

今天在查找一个普通表时,出现了上图所示ORA-01591的错误提示,在网上找了下问题点,

ORA-01591 错误问题说明如下:

Error:  ORA 1591                                                              
Text:   lock held by in-doubt distributed transaction <num >                  
-------------------------------------------------------------------------------
Cause:  An attempt was made to access a resource locked by a dead two-phase   
        commit transaction that is in prepared state.                         
Action: Match the transaction number in the message with the GLOBAL_TRAN_ID   
        column of the DBA_2PC_PENDING table to determine the database link and
        the state of the transaction.                                         
        Attempt to repair network connections to the coordinator and commit   
        point, if necessary.                                                  
        If timely repair is not possible, contact the database administrator  
        at the commit point, if known, to resolve the pending transaction.
以上说明是mos关于该错误的一个描述,当然,引起该错误的原因可能有很多很多,很多时候是由于网络原因造成的,但是单表查询所报的错误提示是由于分布式事务查询时引起,是由于程序员在将操作分布到两个数据库时,突然发生的异常信息。
如此分布式事务,其实可以这样理解,就是一个完整的事务,其中包含的多个操作分布在两个以上的数据库中,只有这些操作都全部完成了,该事务才算完成,不然该事务都将失败。

换句话说,如果该事务失败了,其中涉及到操作表A,那么当其他session访问到表A时将出现ORA-01591错误。

至于具体说为什么分布式事务会失败,那么就要具体分析了&#x
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值