Oracle 查询锁的状态

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:497

[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px]select a.sid blocker_sid,a.serial#,a.username as blocker_username,a.machine as blocker_host,
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] b.type,
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] case b.lmode when 0 then 'None'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 1 then 'NULL'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 2 then 'Row share'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 3 then 'Row Exclusive'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 4 then 'Share'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 5 then 'Share Row Exclusive'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 6 then 'Exclusive'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] end lock_mode,
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] b.ctime as time_held,c.sid as waiter_sid,
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] case c.request when 0
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px]then 'None'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 1 then 'NULL'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 2 then 'Row share'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 3 then 'Row Exclusive'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 4 then 'Share'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 5 then 'Share Row Exclusive'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] when 6 then 'Exclusive'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] end request_mode,
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] c.ctime time_waited,
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] 'alter system kill session '''||a.sid||','||a.serial#||''';' as kill_statement
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] from v$session a,v$lock b,v$enqueue_lock c
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] where a.sid=b.sid
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] and b.id1=c.id1(+)
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] and b.id2=c.id2(+)
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] and c.type(+)='TX'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] and b.type='TX'
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] and b.block=1
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px] order by time_held,time_waited
[color=rgb(57, 57, 57)][font=-apple-system, BlinkMacSystemFont, "][size=14.1px][color=rgb(57, 57, 57)][backcolor=transparent][font=-apple-system, BlinkMacSystemFont, "][size=14px]

本文标签:
本文标题:Oracle 查询锁的状态
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】