Solution to Oracle Database Error ORA-01591

Source: Internet
Author: User

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

 
 
  1. Select 'Rollback force '''||LOCAL_TRAN_ID||'''' from sys.pending_trans$; 

2. Set its COMMIT or ROLLBACK:

 
 
  1. rollback force LOCAL_TRAN_ID;   
  2. commit force LOCAL_TRAN_ID; 

3. If the transaction fails, the transaction is forcibly deleted from the data dictionary.

 
 
  1. set transaction use rollback segment system;   
  2. delete from dba_2pc_pending where local_tran_id = LOCAL_TRAN_ID;   
  3. delete from pending_sessions$ where local_tran_id = LOCAL_TRAN_ID;  
  4. delete from pending_sub_sessions$ where local_tran_id = LOCAL_TRAN_ID;   
  5. commit; 

Generate batch statements:

 
 
  1. begin   
  2. for r in (select local_tran_id   
  3. from dba_2pc_pending t   
  4. where t.state = 'collecting') loop   
  5. --dbms_output.put_line('commit force '''||r.local_tran_id||''';');   
  6. dbms_output.put_line('delete from dba_2pc_pending where local_tran_id = '''||r.local_tran_id||''';');   
  7. dbms_output.put_line('delete from pending_sessions$ where local_tran_id = '''||r.local_tran_id||''';');   
  8. dbms_output.put_line('delete from pending_sub_sessions$ where local_tran_id = '''||r.local_tran_id||''';');   
  9. end loop;   
  10. dbms_output.put_line('commit;');   
  11. 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.