跳到主要内容

实现类似SQL Profile记录功能

select * from v$sql t
where t.LAST_ACTIVE_TIME>(sysdate - interval '3' MINUTE) --执行3分钟内的SQL语句
and t.PARSING_SCHEMA_NAME = 'SCNBPMTEST' --数据库
and (t.MODULE is null or t.MODULE not like '%PL/SQL%') --不是在某些终端里的执行
and lower(t.SQL_TEXT) like '%select%' --查询某类SQL语句
order by t.LAST_ACTIVE_TIME desc