-- SUMMARRY VIEW OF SQL STATISTICS AGGREGATED BY HOUR ------
SELECT TO_CHAR(ss.BEGIN_INTERVAL_TIME,'DD.MM.YYYY HH24') AS hour,SUM(FETCHES_DELTA),SUM(SORTS_DELTA),SUM(DISK_READS_DELTA),SUM(EXECUTIONS_DELTA),SUM(BUFFER_GETS_DELTA),SUM(PLSEXEC_TIME_DELTA),SUM(DIRECT_WRITES_DELTA),SUM(ROWS_PROCESSED_DELTA),SUM(CPU_TIME_DELTA)--,PLAN_HASH_VALUE,BEGIN_INTERVAL_TIME,DISK_READS_DELTA,ROWS_PROCESSED_DELTA,STAT.SQL_ID
FROM DBA_HIST_SQLSTAT STAT, DBA_HIST_SQLTEXT TXT, DBA_HIST_SNAPSHOT SS
WHERE STAT.SQL_ID = TXT.SQL_ID AND STAT.DBID = TXT.DBID
AND SS.DBID = STAT.DBID
AND SS.INSTANCE_NUMBER = STAT.INSTANCE_NUMBER
AND STAT.SNAP_ID = SS.SNAP_ID
AND BEGIN_INTERVAL_TIME > SYSDATE -5
GROUP BY TO_CHAR(ss.BEGIN_INTERVAL_TIME,'DD.MM.YYYY HH24')
ORDER BY 1 ;
Komentarze
Prześlij komentarz