ORACLE二阶段锁问题
来源:互联网 发布:手机淘宝店铺店招尺寸 编辑:程序博客网 时间:2024/05/29 11:06
原文出处:http://blog.chinaunix.net/uid-22340094-id-88101.html
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\"<<! \nalter session set \"_smu_debug_mode\"=4;\nEXECUTE DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('\'%s\'');\n!\n\n",$1,$1,$1}' >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 dba_2pc_pending@bcv_yyb1 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;
0 0
- ORACLE二阶段锁问题
- Oracle启动三阶段(二)
- 二阶段无法解决的问题
- oracle 问题 二
- mysql 数据丢失问题 两阶段锁
- 保研阶段二
- 阶段自考之二
- MySQL(阶段二)
- 内核启动:阶段二
- 泉demo阶段二
- 阶段二设计
- Oracle启动三个阶段
- oracle startup四个阶段
- Oracle学习阶段总结
- 二阶段提交,三阶段提交,Paxos
- 二阶段提交,三阶段提交,Paxos
- oracle问题集(二)
- oracle日常问题(二)
- WP -- 应用版本升级提示
- 新站优化的注意事项
- JAXB
- 1.5-替换字符串中的空格为%20
- 使用open vswitch构建虚拟网络
- ORACLE二阶段锁问题
- HDU1896 优先队列2
- 解决在SecureCRT中使用VIM编辑代码只有黑白色
- 做 SBS SEBSTPR TPE的朋友对甲苯溶液粘度要掌握的
- oracle mysql SqlServer 数据库分页实现sql
- C++ primer(第五版) 练习 5.23、5.24、5.25 个人code
- python中执行shell命令
- Linux内存点滴 用户进程内存空间
- Python模块学习 ---- logging 日志记录