Current Blackouts Analysis (oem_current_blackouts.sql)
What This Script Does
Section titled “What This Script Does”Displays currently active Oracle Enterprise Manager blackouts across all monitored targets, showing blackout status, duration, and scheduling information.
The Script
Section titled “The Script”rem oem_current_blackouts.sqlremttitle 'Current OEM Blackouts'remset linesize 400remcol target_name format a50 Heading 'Target|Name'col TYPE_DISPLAY_NAME format a30 Heading 'Target|Type'col BLACKOUT_STATUS format a16 Heading 'Blackout|Status'col START_DT format a20 Heading 'Start|Date'col END_DT format a20 Heading 'End|Date'col created_by format a20 Heading 'Created|By'col LAST_UPDATED_BY format a20 Heading 'Last Updated|By'col blackout_name format a45 Heading 'Blackout Name'col BLACKOUT_DESC format a80 Heading 'Blackout Desc'col DAYS_ELAPSED format 9999.99 Heading 'Days|Elapsed'remalter session set nls_date_format='yyyy-mm-dd HH24:MI:ss'/remSELECT t.target_name , T.TYPE_DISPLAY_NAME , DECODE (b.blackout_status, 0, 'Scheduled', 1, 'Start Processing', 2, 'Start Partial', 4, 'Started', 5, 'Stop Pending', 6, 'Stop Failed', 7, 'Stop Partial', 8, 'Edit Failed', 9, 'Edit Partial', 10, 'Stopped', 11, 'Ended', 12, 'Partial Blackout', 13, 'Modify Pending', b.blackout_status ) BLACKOUT_STATUS , sysdate - to_date(DECODE(h.start_time, NULL, NULL, mgmt_global.adjust_tz (h.start_time, NVL(s.TIMEZONE_REGION,((s.timezone_offset / 60)||':'|| MOD(s.timezone_offset, 60))), t.TIMEZONE_REGION))) DAYS_ELAPSED , DECODE (h.start_time, NULL, NULL, mgmt_global.adjust_tz (h.start_time, NVL(s.TIMEZONE_REGION,((s.timezone_offset / 60)||':'|| MOD(s.timezone_offset, 60))), t.TIMEZONE_REGION)) START_DT , DECODE (h.end_time, NULL, NULL, mgmt_global.adjust_tz (h.end_time, NVL(s.TIMEZONE_REGION,((s.timezone_offset / 60)|| ':'||MOD (s.timezone_offset, 60))), t.TIMEZONE_REGION)) END_DT , b.created_by , B.LAST_UPDATED_BY , b.blackout_name , B.BLACKOUT_DESC FROM SYSMAN.mgmt_blackouts b, SYSMAN.mgmt_blackout_history h, SYSMAN.mgmt_blackout_flat_targets ft, SYSMAN.mgmt_targets t, SYSMAN.mgmt_blackout_schedule s WHERE b.blackout_guid = h.blackout_guid AND h.blackout_guid = ft.blackout_guid AND ft.target_guid = t.target_guid AND b.blackout_guid = s.blackout_guid AND DECODE (h.start_time, NULL, NULL, mgmt_global.adjust_tz (h.start_time, NVL(s.TIMEZONE_REGION,((s.timezone_offset / 60)||':'|| MOD(s.timezone_offset, 60))), t.TIMEZONE_REGION)) < SYSDATE AND (DECODE (h.end_time, NULL, NULL, mgmt_global.adjust_tz (h.end_time, NVL(s.TIMEZONE_REGION,((s.timezone_offset / 60)|| ':'||MOD (s.timezone_offset, 60))), t.TIMEZONE_REGION)) > SYSDATE OR DECODE (h.end_time, NULL, NULL, mgmt_global.adjust_tz (h.end_time, NVL(s.TIMEZONE_REGION,((s.timezone_offset / 60)|| ':'||MOD (s.timezone_offset, 60))), t.TIMEZONE_REGION)) IS NULL ) and b.blackout_status <> 0 ORDER BY t.type_display_name, DAYS_ELAPSED desc, t.target_name/
Common Use Cases
Section titled “Common Use Cases”Blackout Monitoring
- Track active maintenance windows
- Monitor blackout duration and status
- Review blackout schedules and coverage
Maintenance Planning
- Verify blackout effectiveness
- Plan overlapping maintenance windows
- Coordinate system downtime
Related Scripts
Section titled “Related Scripts”- oem_future_dt - Future downtime planning