oracle 锁与等待
2014-05-05 16:51
369 查看
1. 查看引起等待的死锁
SELECT 'Lock' "Status",
a.username "用户名", a.sid "SID", a.serial# "SERIAL#",
b.type "锁类型",
DECODE(b.lmode, 1, 'No Lock', 2, 'Row Share', 3, 'Row Exclusive', 4, 'Share', 5, 'Share Row Exclusive', 6, 'Exclusive', 'NONE') "占用的模式",
DECODE(b.request, 1, 'No Lock', 2, 'Row Share', 3, 'Row Exclusive', 4, 'Share', 5, 'Share Row Exclusive', 6, 'Exclusive', 'NONE') "请求的模式",
c.object_name "对象名",
c.owner "对象所有者", c.object_type "对象类型",
b.id1 "资源ID1", b.id2 "资源ID2",b.ctime "ctime(秒) ",
'ALTER SYSTEM KILL SESSION '''||a.sid||','||a.serial#||''';' "kill Session ",
'kill -9 '||d.spid "Kill Process (Unix Linux)",
'orakill '||f.instance_name||' '||d.spid "Kill Process (Windows)"
FROM v$session a, v$lock b, v$locked_object b1, dba_objects c, v$process d, v$instance f
WHERE a.type <> 'BACKGROUND'
AND a.sid = b.sid
AND b.request = 0
AND d.addr = a.paddr
AND b1.session_id = a.sid
AND b1.object_id = c.object_id
AND f.status = 'OPEN'
AND f.database_status = 'ACTIVE'
order by b.ctime;
SELECT * FROM v$lock;
SELECT 'Lock' "Status",
a.username "用户名", a.sid "SID", a.serial# "SERIAL#",
b.type "锁类型",
DECODE(b.lmode, 1, 'No Lock', 2, 'Row Share', 3, 'Row Exclusive', 4, 'Share', 5, 'Share Row Exclusive', 6, 'Exclusive', 'NONE') "占用的模式",
DECODE(b.request, 1, 'No Lock', 2, 'Row Share', 3, 'Row Exclusive', 4, 'Share', 5, 'Share Row Exclusive', 6, 'Exclusive', 'NONE') "请求的模式",
c.object_name "对象名",
c.owner "对象所有者", c.object_type "对象类型",
b.id1 "资源ID1", b.id2 "资源ID2",b.ctime "ctime(秒) ",
'ALTER SYSTEM KILL SESSION '''||a.sid||','||a.serial#||''';' "kill Session ",
'kill -9 '||d.spid "Kill Process (Unix Linux)",
'orakill '||f.instance_name||' '||d.spid "Kill Process (Windows)"
FROM v$session a, v$lock b, v$locked_object b1, dba_objects c, v$process d, v$instance f
WHERE a.type <> 'BACKGROUND'
AND a.sid = b.sid
AND b.request = 0
AND d.addr = a.paddr
AND b1.session_id = a.sid
AND b1.object_id = c.object_id
AND f.status = 'OPEN'
AND f.database_status = 'ACTIVE'
order by b.ctime;
SELECT * FROM v$lock;
相关文章推荐
- ORACLE一条SQL查等待语句
- [Oracle] 常见的等待事件
- 数据库服务器CPU持续百分之百、部分Session一直处于执行状态---等待事件为:asynch descriptor resize(Oracle Bug )
- Oracle 等待事件之 db file sequential read
- oracle等待事件I/O上的等待事件
- Oracle Tuning 基础概述01 - Oracle 常见等待事件
- OracleDataAdapter.Fill()处于无限等待中 【已解决】
- 怎样快速查出Oracle 数据库中的锁等待
- 使用DATABASE Log off收集oracle 等待事件信息
- Oracle等待事件
- Oracle中常見等待事件的說明
- oracle笔记整理11——性能调优之oracle等待事件与表关联
- oracle等待事件以及解决方案
- Oracle 等待事件
- ORACLE等待事件:SQL*Net message from client & SQL*Net message to client
- Weblogic报错 <BEA-000337> <BEA-101215> Oracle后台大量等待
- 关于Oracle中DB time等待事件的特别说明,oracle10个/11g的新特点
- Oracle 常见的33个等待事件【转自dave偶像大神】
- oracle等待事件4——buffer busy wait 特别介绍
- oracle等待事件9——I/O上的等待事件 上篇