Oracle CPU Utilization

Description

This alert will calculate the average CPU Utilization in the last 5 minutes based on Ignite 8 CPU metric data that is collected once every 20 seconds. Note: the query below only works with Oracle repositories. If you are using a SQL Server repository, click here.

Note: The example below uses the "CPU Utilization" metric, but a very similar query can be used for other metrics as well. For example, if you wanted to monitor O/S Memory Utilization, you could modify the "where mn.NAME = 'CPU Utilization'" line to "where mn.NAME = 'Memory Utilization'".  For a list of all metric names, you can run these queries:

select id, name from cond; -- use the ID for the instance in the query below for <DBID>

select name from con_metrics_names_<DBID> order by name; -- substitute the value of name into the alert query

SQL Statement

SELECT NVL(AVG(md.V*1.0),-1) avg_cpu_5min
FROM con_metrics_names_#DBID# mn
INNER JOIN con_metrics_#DBID# m ON m.metric_name_id = mn.id
INNER JOIN con_metrics_detail_#DBID# md ON m.id = md.metrics_id
WHERE mn.name = 'CPU Utilization'
AND md.d >= SYSDATE - (5/1440)

Alert Definition