Chinaunix首页 | 论坛 | 博客
  • 博客访问: 215607
  • 博文数量: 78
  • 博客积分: 582
  • 博客等级: 下士
  • 技术积分: 560
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-15 09:06
文章分类

全部博文(78)

文章存档

2012年(50)

2011年(1)

2010年(27)

分类:

2011-01-14 17:33:50

来源:
select  local_tran_id,
        nvl(global_oracle_id, global_tran_fmt||'.'||global_foreign_id),
        state, decode(status,'D','yes','no'), heuristic_dflt, tran_comment,
        fail_time, heuristic_time, reco_time,
        top_os_user, top_os_terminal, top_os_host, top_db_user, global_commit#
from    sys.pending_trans$

sqlplus "/as sysdba" <set head off
set feedback off
set serveroutput off
set pagesize 0
set linesize 500
spool ss
select LOCAL_TRAN_ID from dba_2pc_pending;
spool off
!
cat ss.lst |awk '{printf "sqlplus \"/as sysdba\"<ttt
sh ttt
 
1、查找
select   GLOBAL_TRAN_ID   from     DBA_2PC_PENDING;  
2、强制提交或回滚
ROLLBACK   FORCE   '&GLOBAL_TRAN_ID';  
commit   froce   &GLOBAL_TRAN_ID';  

如:
rollback   force   '13.83.15198 ';

3、或者将事务对应的session杀掉[对应session]
select t.*,rowid from t;select t.*,rowid from sys.pending_trans$ t;select t.*,rowid from sys.PENDING_SESSIONS$ t;
 
 
处理方式四种
 

A: Cleanup Steps: Before you begin, make note of the local transaction ID,, from the error message reported.
1. Determine if you want to attempt a commit or rollback of this transaction. You can do the following select to help determine what action to take:
SQL>; select state, advice from dba_2pc_pending where
local_tran_id = "";
2. Commit or rollback the transaction. To commit: SQL>; commit force ““; To rollback:
SQL>; rollback force ““;
3. If your are using release 7.3.x or greater and Step 1 above fails, execute the following command in either Server Manager or SQL*Plus: SQL>; execute dbms_transaction.purge_lost_db_entry(““);
NOTE: The purge_lost_db_entry function is fully documented in the "dbmsutil.sql" script located in the "$ORACLE_HOME/rdbms/admin" directory.
4. If running a release below 7.3 -OR- both Steps 1 and 2 above have failed, do the following: Connect to Server Manager or SQL*Plus and execute the following commands:
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;
阅读(2238) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~