Re: AWR report generator for past periods (with graphs)?

From: Ls Cheng <exriscer_at_gmail.com>
Date: Thu, 6 Sep 2012 23:35:42 +0200
Message-ID: <CAJ2-Qb86Vg_0zhV35LrBrCJjog2GMxNPLYWi9ZbJS5RZXC-s9A_at_mail.gmail.com>



I use this sql

select TO_CHAR(TRUNC(sample_time, 'hh'), 'mm-dd hh24') sample_timestamp,

       state,
       count(*)/360 avg_active_sess
  from
       (select sample_time, sample_id,
               CASE
                   WHEN session_state = 'ON CPU' THEN 'CPU'
                   WHEN session_state = 'WAITING' THEN wait_class
                   ELSE 'Misc Waits'
               END state
         from dba_hist_active_sess_history
        where session_type IN ('FOREGROUND')
          and sample_time > TO_DATE (:start_time, 'yyyymmdd hh24mi')
          and sample_time < TO_DATE (:end_time, 'yyyymmdd hh24mi')
       )

group by TO_CHAR(TRUNC(sample_time, 'hh'), 'mm-dd hh24'), state order by TO_CHAR(TRUNC(sample_time, 'hh'), 'mm-dd hh24'), state;
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Sep 06 2012 - 16:35:42 CDT

Original text of this message