标签:blog http io ar os 使用 sp for 数据
http://blog.csdn.net/tclcaojun/article/details/6777022错误代码:ORA-01591
错误原因:使用了分布式事务,造成这个问题的原因很多时候都是由于网络问题造成的
解决办法:
1.找到TRAN_ID
Select ‘Rollback force ‘‘‘||LOCAL_TRAN_ID||‘‘‘‘ from sys.pending_trans$;
2.將其COMMIT或ROLLBACK:
rollback force LOCAL_TRAN_ID;
commit force LOCAL_TRAN_ID;
3.如果执行失败,则强行从资料字典中删除该交易记录:
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;
4.执行失败,还一种情况可以尝试下重起一下Oracle服务,这种情况我遇到过一次,重新启动后该锁自动解除(因为对删除数据字典比较担心,所以胡乱试了一次重启数据库,前提是执行了commit force LOCAL_TRAN_ID;失败之后重新启动)
5.生成语句操作语句的程序
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;
本文链接地址:http://blog.csscss.org/post/16.shtml
本文原标题:ORA-01591错误的原因和处理方法
标签:blog http io ar os 使用 sp for 数据
原文地址:http://www.cnblogs.com/svennee/p/4083373.html