ORACLE查询系统中阻塞情况~
2009-11-24 21:41
351 查看
在ORACLE中经常会碰到阻塞的情况发生,这个时候我们就需要快速的找出导致阻塞的原因,并尽快排除它,好让系统重新正常运行。
下面以死锁为例,来看看如何找出导致阻塞的会话并解决问题。
下面以死锁为例,来看看如何找出导致阻塞的会话并解决问题。
//SCOTT窗口1 SQL> select * from t2; ID ---------- 3 1 2 SQL> update t2 set id=12 where id=2; 1 row updated. SQL> //SCOTT窗口2 SQL> select * from t2; ID ---------- 3 1 2 SQL> update t2 set id=11 where id=3; 已更新 1 行。 SQL> update t2 set id=13 where id=2; //此时进入等待……卡住不动了 //SYS窗口 SQL> select c.terminal||' ('''||a.sid||','||c.serial#||''') is blocking '||b.sid ||','||d.serial# block_msg, a.block 2 from v$lock a,v$lock b,v$session c,v$session d 3 where a.id1=b.id1 4 and a.id2=b.id2 5 and a.block>0 6 and a.sid <>b.sid 7 and a.sid=c.sid 8 and b.sid=d.SID 9 ; BLOCK_MSG BLOCK ---------------------------------------- ---------- HWANG ('138,305') is blocking 153,15 1 SQL> select sid,serial#,username from v$session where username is not null; SID SERIAL# USERNAME ---------- ---------- ------------------------------ 136 179 SYS 138 305 SCOTT 153 15 SCOTT //这个时候可以杀掉那个BLOCKER SQL> alter system kill session'138,305'; System altered. //SCOTT窗口1 SQL> select * from t2; select * from t2 * ERROR at line 1: ORA-00028: your session has been killed SQL>
相关文章推荐
- 查询oracle会话间的阻塞情况
- 在Oracle中查询表的大小、表的占用情况和表空间的大小
- 第二天2-6】【recyclebin】【复制方式创建表】【查询oracle block大小】【indows上的文件系统块大小】【em等开放的端口】
- Oracle 查询表空间使用情况(转)
- oracle 阻塞 查询
- 查询当前数据库是否存在阻塞的情况
- Oracle系统表查询
- oracle安装前系统配置查询(linux)
- oracle安装前系统配置查询(linux)
- oracle安装前系统配置查询(linux)
- Oracle系统表的查询
- oracle查询表空间使用情况
- Oracle-07-数据类型例子&查询当前系统时间&创建表语法
- ORACLE查询数据库的锁表情况
- oracle查看系统资源占用情况
- oracle 数据库资源使用情况查询(表空间使用情况等)
- Oracle查询表空间使用情况
- OracleCPU使用情况查询
- Oracle CPU使用情况查询
- oracle查询表空间的空间占用情况