`
fanjf
  • 浏览: 299079 次
  • 性别: Icon_minigender_1
  • 来自: 安徽
社区版块
存档分类
最新评论

Oracle查询锁表的SQL语句

阅读更多

select a.sid "会话ID",
       a.serial# "会话序列号",
       c.object_name "被锁的表名",
       a.machine "锁表的机器名",
       'alter system kill session ' || '''' || a.sid || ',' || a.serial# ||
       ''' ;' "KILL_SQL",
       a.*
  from v$session       a,
       v$locked_object b,
       dba_objects     c,
       v$bgprocess     d,
       v$process       e
 where a.sid = b.session_id
   and b.object_id = c.object_id
   and a.paddr = e.addr
   and a.paddr = d.paddr(+);

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics