sql developer daily ash statistics chart query

From: LS Cheng <exriscer_at_gmail.com>
Date: Wed, 9 Nov 2011 01:01:43 +0100
Message-ID: <CAJ2-Qb98gkeMjUg55VzOpaiHWuay4FFDmyv0eWBcm4n2bYSupg_at_mail.gmail.com>

In SQL Developer there are few AWR/ASH report available, one of them is daily ash statistics chart and made up by following query

select to_char(trunc((sample_time),'HH'),'HH24:MI'), state, count(*)/360 from
  (select sample_time, sample_id
  , CASE WHEN session_state = 'ON CPU' THEN 'CPU'

           WHEN session_state = 'WAITING' AND wait_class IN ('User I/O') THEN 'IO'
           WHEN session_state = 'WAITING' AND wait_class IN ('Cluster') THEN 'CLUSTER'
           ELSE 'WAIT' END state
    where session_type IN ( 'FOREGROUND')     and sample_time between trunc(sysdate,'HH') - 25/24 and trunc(sysdate,'HH') - 1/24 )
group by trunc((sample_time),'HH'), state order by trunc((sample_time),'HH')

Does anyone know why we divide count(*) by 360?




http://www.freelists.org/webpage/oracle-l Received on Tue Nov 08 2011 - 18:01:43 CST

Original text of this message