I use this script to find out how the sql run in the history
col buffer_gets_DELTA for 999,999,999
col buffer_gets_total for 999,999,999,999
col stat_time for a15
col end_time for a15
select sql_id,PLAN_HASH_VALUE,to_char(BEGIN_INTERVAL_TIME,'hh24:mi-dd-mon') start_time,to_char(end_intervAL_TIME,'hh24:mi-dd-mon') end_time,
BUFFER_GETS_DELTA,buffer_gets_total,round(cpu_time_delta/1000000) "cpu_time_del(s)",round(ELAPSED_TIME_DELTA/1000000) "ele_del(s)"
from dba_hist_sqlstat st, DBA_HIST_SNAPSHOT sn
where st.snap_id=sn.snap_id and
BEGIN_INTERVAL_TIME > sysdate-&days
and sql_id='&sql_id'
order by BEGIN_INTERVAL_TIME;
undefine snap_id
undefine sql_id
col buffer_gets_DELTA for 999,999,999
col buffer_gets_total for 999,999,999,999
col stat_time for a15
col end_time for a15
select sql_id,PLAN_HASH_VALUE,to_char(BEGIN_INTERVAL_TIME,'hh24:mi-dd-mon') start_time,to_char(end_intervAL_TIME,'hh24:mi-dd-mon') end_time,
BUFFER_GETS_DELTA,buffer_gets_total,round(cpu_time_delta/1000000) "cpu_time_del(s)",round(ELAPSED_TIME_DELTA/1000000) "ele_del(s)"
from dba_hist_sqlstat st, DBA_HIST_SNAPSHOT sn
where st.snap_id=sn.snap_id and
BEGIN_INTERVAL_TIME > sysdate-&days
and sql_id='&sql_id'
order by BEGIN_INTERVAL_TIME;
undefine snap_id
undefine sql_id
Comments
Post a Comment