由于远程数据库的异常中断或者是关闭,本地数据库对远程数据库的分布式事务经常会出现连续的报错到alert.log文件中。ORA-02068: following severe error from LNK_DB2_STB
ORA-01033: ORACLE initialization or shutdown in progress
[@more@]
如果远程数据库短时间内无法恢复,这个错误可能会一直报下去,有的时候,对于这样分布式事务,可以简单称为事务的挂起状态,我们可以采用强制手段将该事务清除。
首先,检查挂住的事务select local_tran_id from dba_2pc_pending where state='collecting';
首先,可以试图提交或者回滚该事务SQL> select state, advice from dba_2pc_pending where local_tran_id = "";
强行提交:SQL> commit force "";
强行回滚:SQL> rollback force "";
如果执行失败,也可以强行从数据字典中删除改事务的记录
代码: SQL> set transaction use rollback segment system;
SQL> delete from dba_2pc_pending where local_tran_id = "";
SQL> delete from pending_sessions$ where local_tran_id = "";
SQL> delete from pending_sub_sessions$ where local_tran_id = "";
SQL> commit;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/72950/viewspace-927284/
,如需转载,请注明出处,否则将追究法律责任。