f you got ” ORA-01591: lock held by in-doubt distributed transaction ” error, it means there are some uncommitted transactions in the database.
We need to perform rollback or commit force for Uncommitted transactions to solve this problem.
ORA-01591
You can query uncommitted or pending transaction with following script. This script will generate rollback force command also, so you can execute the result of following command.
You can check from your user schema but execute rollback or commit from SYS user .
SQL> select 'rollback force '''||local_tran_id||''';' from DBA_2PC_PENDING where state='prepared';
rollback force '72.6.1262301';
Then from SYS user execute below command:
SQL> rollback force '72.6.1262301';
SQL> commit force '72.6.1262301';