Oracle–查询时间段内执行的查询时间段内执行的sql、、Produce
1.查询时间段内执行的sql、Produce
select * from v$sqlarea a
where 1=1
and a.LAST_ACTIVE_TIME >= to_date( '2013-02-21 18:23:00','yyyy-MM-dd HH24:mi:ss')
and a.LAST_ACTIVE_TIME < to_date( '2013-02-21 18:24:00','yyyy-MM-dd HH24:mi:ss')
--and a.LAST_ACTIVE_TIME < to_date('2012-02-21 17:55','yyyy-MM-dd HH24:mi:ss')
and a.MODULE_HASH 0
and a.MODULE = 'JDBC Thin Client'
order by a.LAST_ACTIVE_TIME desc
2.查询带关键字的过程
select t.name,t.text from all_source t where type = 'PROCEDURE' and text like '%:B1 FOR UPDATE%'
3.查询带关键字的函数
select t.name,t.text from all_source t where type = 'function' and text like '%:B1 FOR UPDATE%'
4.查询带关键字的SQL文
select * from v$sqlarea a where sql_id = '7r5jkt6x5uhpg'
select * from v$sqlarea a where a.text like '%7%'
5.キーワードとしてデータベース資源を検索
例:
select * from dba_source ds where ds.text like '%:B1 FOR UPDATE%'
select t.name,t.text from all_source t where text like '%RQ_MNG.SYS_CALL_USER%'
6.Produce内容を検索
select text from all_source@db207 where owner='ECC_CMP' and name=upper('SP_CALL_PROCEDURE_INTER');
作者:DB王子様
评论0