ORA-01591: lock held by in-doubt distributed transaction 14.19.171170
> select LOCAL_TRAN_ID,STATE,COMMIT# from dba_2pc_pending;
LOCAL_TRAN_ID STATE COMMIT#
---------------------- ---------------- ----------------
13.27.177217 forced rollback 2072410988
30.12.17616 forced rollback 1968528119
3.28.138795 prepared 2301659953
14.19.171170 prepared 2211492678
Elapsed: 00:00:00.01
> ROLLBACK FORCE '3.28.138795';
Rollback complete.
Elapsed: 00:00:00.10
> ROLLBACK FORCE '14.19.171170';
Rollback complete.
Elapsed: 00:00:00.10
> select LOCAL_TRAN_ID,STATE,COMMIT# from dba_2pc_pending;
LOCAL_TRAN_ID STATE COMMIT#
---------------------- ---------------- ----------------
13.27.177217 forced rollback 2072410988
30.12.17616 forced rollback 1968528119
3.28.138795 forced rollback 2301659953
14.19.171170 forced rollback 2211492678
Elapsed: 00:00:00.01
检查dba_2pc_pending的state列,如果是commited,意味着本地数据库提交已经成功。其他节点需要根据本地事务号和最大的commit#进行强制提交。用法如下:
SVRMGR> COMMIT FORCE 'your local transactionID on this node', 'highest SCN from already committed site';
SVRMGR> COMMIT FORCE '1.13.5197', '88123887';
如果commit point site的state为 commited 外的其他状态,则表明commit point site 没有提交成功,分布式事务需要强制回滚。这里不再需要所有节点的最大commit#。用法如下:
SVRMGR> ROLLBACK FORCE 'your local transactionID on this node';
SVRMGR> ROLLBACK FORCE '1.13.5197';