Like most Oracle shops, we use Grid Control to monitor and give insight into our DB environments. The Grid Control repository is loaded with lots of useful information which sometimes is not always evident or accessible via the Grid Control GUI. Some of us have even attempted to reverse engineer the GC schema to try and answer some questions that we have. This is a collection of scripts/queries I use against the GC repository to get some answers I am looking for. If you have some scripts/pointers, then please share them
.
Run the following query for current metrics. This shows what thresholds Alerts will be triggered for (Alerts not email/pager notification – that is part of notification rules).
SELECT a.target_name, a.target_type, a.metric_name, a.metric_column,
DECODE(TRIM(a.warning_threshold), '',
DECODE(TRIM(a.critical_threshold), '', 'DISABLED', 'ENABLED'), 'ENABLED') STATUS ,
a.warning_operator, a.warning_threshold, a.critical_operator,
a.critical_threshold,
REPLACE(REGEXP_SUBSTR(b.schedule_ex, '"[^"]*"'), '"', '') FREQUENCY,
NVL(REPLACE(REPLACE(REGEXP_SUBSTR(b.schedule_ex, 'T="[^"]*"'), 'T=', ''),'"', ''), 'Minutes') FREQUENCY_UNIT,
c.frequency_code, a.occurence_count, a.warning_count,
a.critical_count, c.is_enabled
FROM MGMT$METRIC_COLLECTION a, SYSMAN.MGMT_METRIC_COLLECTIONS b, sysman.MGMT$TARGET_METRIC_COLLECTIONS c
WHERE a.target_guid = b.target_guid
and a.target_guid = c.target_guid
and b.metric_guid = c.metric_guid
and a.metric_name = c.metric_name
ORDER BY target_name, target_type, a.metric_name;
Next, Notification Methods need to be queried to determine which alerts Oracle sends our emails for.
SELECT RULE_NAME, OWNER, TARGET_TYPE, TARGET_NAME, TARGET_GUID,
METRIC_NAME, METRIC_COLUMN, KEY_VALUE, KEY_PART_1, KEY_PART_2,
KEY_PART_3, KEY_PART_4, KEY_PART_5, WANT_CLEARS, WANT_WARNINGS,
WANT_CRITICAL_ALERTS, WANT_TARGET_UP, WANT_TARGET_DOWN,
WANT_TARGET_UNREACHABLE_START, WANT_TARGET_UNREACHABLE_END,
WANT_TARGET_METRIC_ERR_START, WANT_TARGET_METRIC_ERR_END,
WANT_TARGET_BLACKOUT_START, WANT_TARGET_BLACKOUT_END,
WANT_POLICY_CLEARS, WANT_POLICY_VIOLATIONS,
WANT_WARNING_JOB_SUCCEEDED, WANT_WARNING_JOB_PROBLEMS,
WANT_CRITICAL_JOB_SUCCEEDED, WANT_CRITICAL_JOB_PROBLEMS,
WANT_POLICY_JOB_SUCCEEDED, WANT_POLICY_JOB_PROBLEMS, IGNORE_RCA
FROM SYSMAN.MGMT_NOTIFY_RULE_CONFIGS;
This final Query will combine the 2 to show alerts and if they will be notified on.
Read the rest of this entry »