• 异常:ORA01591: 锁被有问题的分布式事务处理 10.19.142615 持有


    今天执行几个删除语句,其中一个删除语句是通过透明网关去删除另一个数据库的表,结果执行后弹出这个错误。然后查询其它已经删除的的表删除的行的时候,弹出已经被分布式事务锁定,无法操作。

    最后参考:

    Manually Committing an In-Doubt Transaction

    Before attempting to commit the transaction, ensure that you have the proper privileges. Note the following requirements:

     

    If the transaction was committed by... Then you must have this privilege...

    You

    FORCE TRANSACTION

     

    Another user

    FORCE ANY TRANSACTION

     

     

    Committing Using Only the Transaction ID

    The following SQL statement commits an in-doubt transaction:

     

    COMMIT FORCE 'transaction_id';

     

     

    The variable transaction_id is the identifier of the transaction as specified in either the LOCAL_TRAN_ID or GLOBAL_TRAN_ID columns of the DBA_2PC_PENDING data dictionary view.

     

    For example, assume that you query DBA_2PC_PENDING and determine that LOCAL_TRAN_ID for a distributed transaction is 1:45.13.

     

    You then issue the following SQL statement to force the commit of this in-doubt transaction:

     

    COMMIT FORCE '1.45.13';

     

    Committing Using an SCN

    Optionally, you can specify the SCN for the transaction when forcing a transaction to commit. This feature allows you to commit an in-doubt transaction with the SCN assigned when it was committed at other nodes.

     

    Consequently, you maintain the synchronized commit time of the distributed transaction even if there is a failure. Specify an SCN only when you can determine the SCN of the same transaction already committed at another node.

     

    For example, assume you want to manually commit a transaction with the following global transaction ID:

     

    SALES.ACME.COM.55d1c563.1.93.29

     

    First, query the DBA_2PC_PENDING view of a remote database also involved with the transaction in question. Note the SCN used for the commit of the transaction at that node. Specify the SCN when committing the transaction at the local node. For example, if the SCN is 829381993, issue:

     

    COMMIT FORCE 'SALES.ACME.COM.55d1c563.1.93.29', 829381993;

     

    See Also:

    Oracle9i SQL Reference for more information about using the COMMIT statement

     

     

    Manually Rolling Back an In-Doubt Transaction

    Before attempting to roll back the in-doubt distributed transaction, ensure that you have the proper privileges. Note the following requirements:

     

    If the transaction was committed by... Then you must have this privilege...

    You

    FORCE TRANSACTION

     

    Another user

    FORCE ANY TRANSACTION

     

     

    The following SQL statement rolls back an in-doubt transaction:

     

    ROLLBACK FORCE 'transaction_id';

     

     

    The variable transaction_id is the identifier of the transaction as specified in either the LOCAL_TRAN_ID or GLOBAL_TRAN_ID columns of the DBA_2PC_PENDING data dictionary view.

     

    For example, to roll back the in-doubt transaction with the local transaction ID of 2.9.4, use the following statement:

     

    ROLLBACK FORCE '2.9.4';

     

    这些官方说明

    执行语句:

    COMMIT FORCE '10.19.142615';

    然后再进行查询,ok解决问题。

    作者:王春明 出处:http://wangchunming.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    Beyond Compare 30天评估期已过解决方案
    windows快捷键及命令
    表情包的转码解码
    html+css实现文本从右向左
    js控制页面滚回上一记录位置
    将base64转为二进制
    牛客挑战赛58
    字符串专题
    牛客挑战赛59
    组合数学专题
  • 原文地址:https://www.cnblogs.com/wangchunming/p/3042059.html
Copyright © 2020-2023  润新知