How to calculate DB time for a week

DB Time is a period demonstrate measurement that is the entirety of Oracle process CPU utilization and non-inert hold up time. While advancing Oracle frameworks we regularly center around decreasing “time”, however ordinarily database work is additionally part of the condition.

     SELECT sum(Round(NVL((e.value - s.value),-1)/60/1000000,2))/1440 ||' days' "DB Time"
FROM   DBA_HIST_SYS_TIME_MODEL s,
       DBA_HIST_SYS_TIME_MODEL e
WHERE  s.snap_id = (select min(snap_id) from dba_hist_snapshot where trunc(begin_interval_time) > sysdate-7) AND
       e.snap_id = (select max(snap_id) from dba_hist_snapshot)  AND
       e.dbid = s.dbid AND
       e.instance_number = s.instance_number AND
       s.stat_name = 'DB time' AND
       e.stat_id = s.stat_id;

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.