3 Replies Latest reply on Jun 17, 2013 12:32 PM by DK2010

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

    Siva Ora

      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