Get critical alerts report from EM with MGMT$ views

You have to immedately interfere critical alerts from EM. Because it is in critcal threshold. And if you not it cause a problem soon.

But sometimes, you need to get big picture, maybe you need a summary or you need to view all alerts togather. In this stuation, you will use this query to view all critical alerts in same result set.

SELECT ac.target_name,
         ac.target_type,
         ac.metric_name,
         ac.metric_column,
         ac.metric_label,
         ac.column_label,
         ac.key_value,
         TO_CHAR (ac.collection_timestamp, 'DD/MM/YYYY HH24:MI:SS') AS alert_time,
         ac.violation_level,
         ac.message,
         ac.current_value
    FROM SYSMAN.MGMT$ALERT_CURRENT ac,  sysman.mgmt$target tg
   WHERE     ac.collection_timestamp >= SYSDATE - 1 --change interval accrding to your needs
         AND ac.alert_state = 'Critical'
         AND ac.TARGET_GUID=tg.TARGET_GUID 
         and tg.target_type IN ('oracle_database',
                                'oracle_listener',
                                'host',
                                'oracle_emd',
                                'oracle_home',
                                'oracle_dbsys')  --add target_types that you need to get 
ORDER BY alert_time, ac.target_name;

Leave a comment