我正在尝试查找用户在 AWR 的快照 ID 之间的时间间隔内执行的历史 sql_id。我正在使用视图DBA_HIST_ACTIVE_SESS_HISTORY
,DBA_USERS
并DBA_HIST_SNAPSHOTS
尝试查找username
,等。但是经过一些测试后sql_id
,sample_time
所有执行的 sql 都没有列在以下查询的输出中
col username for a30;
col BEGIN_INTERVAL_TIME for a30;
col END_INTERVAL_TIME for a30;
COL SAMPLE_TIME FOR A30;
set linesize 2000;
select * from (
select b.BEGIN_INTERVAL_TIME,b.END_INTERVAL_TIME,u.username,a.SESSION_ID,a.SESSION_SERIAL#,
a.INSTANCE_NUMBER,a.sql_id,A.SAMPLE_TIME from DBA_HIST_ACTIVE_SESS_HISTORY a
inner join dba_users u
on u.user_id=a.user_id
inner join dba_hist_snapshot b
on b.snap_id=a.snap_id
where b.snap_id >= 40 and b.snap_id <= 46
order by BEGIN_INTERVAL_TIME desc) where rownum <= 50;
为什么会这样?还有其他方法吗?