--一条SQLID的详细运行情况(单条平均)
select to_date(to_char(b.end_interval_time, 'yyyy-mm-dd hh24:mi'), 'yyyy-mm-dd hh24:mi') snap_time, a.sql_id,
plan_hash_value,
executions_delta,
round(disk_reads_delta / executions_delta) disk_reads,
round(buffer_gets_delta / executions_delta) buffer_gets,
round(rows_processed_delta/ executions_delta) rows_processed,
rows_processed_delta sum_rows_processed,
round(cpu_time_delta/ executions_delta /1000,3) cpu_time_ms_delta,
round(elapsed_time_delta/ executions_delta/1000,3) elapsed_time_ms_delta
from dba_hist_sqlstat a, dba_hist_snapshot b
where a.snap_id = b.snap_id
and a.instance_number = b.instance_number
and a.sql_id = '20ny69pzcgk4z'
--and b.end_interval_time >= sysdate - 6/24
and b.end_interval_time >= to_date('2014-03-24 00:30:00','yyyy-mm-dd hh24:mi:ss')
and b.end_interval_time < to_date('2014-03-24 22:00:00','yyyy-mm-dd hh24:mi:ss')
and a.instance_number = 1
and executions_delta <> 0
order by snap_time desc;
统计一条sql_id的信息,详细的运行情况
最新推荐文章于 2023-03-01 17:11:21 发布