zoukankan      html  css  js  c++  java
  • 查看行锁持有者对应的SQL【2】

    select c.sql_text,
           a.*,
           b.object_name,
           to_date(to_char(c.LAST_active_TIME, 'hh24:mi:ss'), 'hh24:mi:ss') active_time,
           to_date(to_char(sysdate - a.ctime / 24 / 60 / 60, 'HH24:MI:SS'),
                   'HH24:MI:SS') as lock_time,
           to_date(to_char(sysdate - a.ctime / 24 / 60 / 60 - 10 / 24 / 60 / 60,
                           'HH24:MI:SS'),
                   'HH24:MI:SS') min_time
      from (select sid, id1, ctime
              from v$lock
             where sid in (select sid
                             from v$lock
                            where type in ('TM', 'TX')
                              and lmode = 6)
               and type = 'TM') a,
           dba_objects b,
           v$sqlarea c
     where a.id1 = b.object_id
       and to_date(to_char(c.LAST_active_TIME, 'hh24:mi:ss'), 'hh24:mi:ss') <=
           to_date(to_char(sysdate - a.ctime / 24 / 60 / 60, 'HH24:MI:SS'),
                   'HH24:MI:SS')
       and c.PARSING_SCHEMA_NAME = 'TEST'
       and (c.sql_text like '%update%' or c.sql_text like '%delete%' or
           c.sql_text like '%insert%')
       and c.sql_text like '%t100%'
       and to_date(to_char(c.LAST_active_TIME + 10 / 24 / 60 / 60, 'hh24:mi:ss'),
                   'hh24:mi:ss') >=
           to_date(to_char(sysdate - a.ctime / 24 / 60 / 60 - 10 / 24 / 60 / 60,
                           'HH24:MI:SS'),
                   'HH24:MI:SS')

  • 相关阅读:
    python-杂烩
    24 Python 对象进阶
    23 Python 面向对象
    22 Python 模块与包
    21 Python 异常处理
    20 Python 常用模块
    18 Python 模块引入
    2 Python 基本语法
    1 Python 环境搭建
    3 Python os 文件和目录
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351998.html
Copyright © 2011-2022 走看看