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 fWHERE 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' --and c.object_name ='CSEWS'order by b.ctime;
select * from v$session;--查看session
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341