DBA_HIST_SQLSTAT - number of execution for any AWR snapshot(s)
Hello everyone
We were trying to work on a script using which we can determine if during any past AWR period, which SQLs were executed and how many times it was executed.
This is the script we came up with
select sql_id,sum(EXECUTIONS_DELTA) TOT_EXEC
from dba_hist_sqlstat
where snap_id between 107187 and 10718
and parsing_schema_name not in
('SYS','DBSNMP')
and executions_delta > 0
group by sql_id
order by 2 desc
Here is the (reduced) output
We thought we had the correct script but we wanted to verify the numbers so we ran an AWR report for the same AWR Snapshots that we used in the script