InOracleDatabase Operation encounteredORA-01591The cause of the error is that the distributed transaction is used. The cause of this problem is often caused by network problems.
The solution is as follows:
1. Find TRAN_ID
- Select 'Rollback force '''||LOCAL_TRAN_ID||'''' from sys.pending_trans$;
2. Set its COMMIT or ROLLBACK:
- rollback force LOCAL_TRAN_ID;
- commit force LOCAL_TRAN_ID;
3. If the transaction fails, the transaction is forcibly deleted from the data dictionary.
- set transaction use rollback segment system;
- delete from dba_2pc_pending where local_tran_id = LOCAL_TRAN_ID;
- delete from pending_sessions$ where local_tran_id = LOCAL_TRAN_ID;
- delete from pending_sub_sessions$ where local_tran_id = LOCAL_TRAN_ID;
- commit;
Generate batch statements:
- begin
- for r in (select local_tran_id
- from dba_2pc_pending t
- where t.state = 'collecting') loop
- --dbms_output.put_line('commit force '''||r.local_tran_id||''';');
- dbms_output.put_line('delete from dba_2pc_pending where local_tran_id = '''||r.local_tran_id||''';');
- dbms_output.put_line('delete from pending_sessions$ where local_tran_id = '''||r.local_tran_id||''';');
- dbms_output.put_line('delete from pending_sub_sessions$ where local_tran_id = '''||r.local_tran_id||''';');
- end loop;
- dbms_output.put_line('commit;');
- end;
4. execution failed. In another case, you can try to restart the Oracle service. In this case, I encountered a problem. After the restart, the lock is automatically removed because I am worried about deleting the data dictionary, therefore, I tried to restart the database once, provided that the commit force LOCAL_TRAN_ID was executed and restarted after the failure ).
The above is the Oracle Database Error ORA-01591 of several detailed solutions, I hope this introduction can be a harvest for you!