This discussion is archived
3 Replies Latest reply: Jun 17, 2013 5:32 AM by DK2010 RSS

OEM Grid 11g Query on Count and Average of Metric alert per day

Sivaprasad S Newbie
Currently Being Moderated

OEnvironment:

Oracle Enterprise Manager 11g

 

I like to have query on the Count and Average numbers of alert for each Metric.  I tried below, but what to know how to get the average number of alerts per day.

 

select   to_char(COLLECTION_TIMESTAMP,'YY-MM-DD') day, count(distinct COLLECTION_TIMESTAMP ) Counts_per_day,METRIC_NAME
from MGMT$ALERT_NOTIF_LOG
where COLLECTION_TIMESTAMP > '01-JUN-2013 00:00:01'
group by to_char(COLLECTION_TIMESTAMP,'YY-MM-DD') ,METRIC_NAME
order by Day,METRIC_NAME

 

Sample Output:

DAY      COUNTS_PER_DAY
-------- --------------
13-06-01              3
13-06-02              4
13-06-03              7
13-06-04             18
13-06-05             11
13-06-06             17
13-06-07             25
13-06-08             32
13-06-09             20
13-06-10             16
13-06-11              2