The maintenance_mode probe does not archive expired maintenance schedules. As a result, this may impact the user response times in UMP.
UIM 9.X and earlier
Attached is an MS SQL script containing 3 queries that can be used to help.
Anyone of these 3 queries can be run as seen fit. It is advisable to backup the tables before running the script.
You may also change the "DELETE" to a "SELECT" before running.
Note: Be careful when cleaning up Schedules and Windows. In addition to the nas probe suppressing alarms the windows are
also used by SLA Reports, and USM graphs (graphs will display maintenance windows, shaded grey area). If reducing the
number of days to keep please check to see if these are needed for SLA's or graphs.
Note: for older installs it may be necessary to change the database name in the scripts from CA_UIM to NimsoftSLM.
For Oracle DB, here is the Steps:
below is the converted script.
Before running this script in Production environment, please do a test it in your test environment and validate results and then execute in production.
MOST IMPORTANT: please take backup of maintenance_window,maintenance_schedule,maintenance_schedule_members tables before executing in production:
declare
cursor devicecursor is
select ms.schedule_id as sch_id from maintenance_schedule ms left join maintenance_schedule_members msm
on msm.schedule_id=ms.schedule_id where msm.cs_id IS NULL;
v_ctr pls_integer := 0;
begin
for rec in devicecursor
loop
v_ctr := v_ctr + 1;
delete from maintenance_schedule ms where ms.schedule_id=rec.sch_id;
delete from maintenance_window mw where mw.schedule_id = rec.sch_id;
if (mod(v_ctr, 1000) = 0) then
commit;
end if;
end loop;
commit;
end;
/
--- Cleanup of maintenance schedules older than 60 days
declare
cursor plancursor is
select ms.schedule_id as sch_id from maintenance_schedule ms left join
maintenance_schedule_members msm on msm.schedule_id=ms.schedule_id
left join
cm_computer_system ccs on
ccs.cs_id=msm.cs_id
where ms.recurrence_pattern =0
and ms.recurrence_period=0
and ms.start_time < trunc(sysdate) - 60
and ms.duration < 86400;
v_ctr pls_integer := 0;
begin
for rec in plancursor
loop
v_ctr := v_ctr + 1;
delete from maintenance_schedule_members msm where msm.schedule_id=rec.sch_id;
delete from maintenance_window mw where mw.schedule_id = rec.sch_id;
delete from maintenance_schedule ms where ms.schedule_id = rec.sch_id;
if (mod(v_ctr, 1000) = 0) then
commit;
end if;
end loop;
commit;
end;
/
--- Cleanup of old maintenance WINDOWS
declare
cursor windowcursor is
select mw.window_id as win_id from maintenance_window mw where mw.schedule_id is NULL;
v_ctr pls_integer := 0;
begin
for rec in windowcursor
loop
v_ctr := v_ctr + 1;
delete from maintenance_window mw where mw.window_id=rec.win_id;
if (mod(v_ctr, 1000) = 0) then
commit;
end if;
end loop;
commit;
end;
/
declare
cursor windowcursor2 is
select mw.window_id as win_id from maintenance_window mw where mw.end_time < trunc(sysdate) - 60;
v_ctr pls_integer := 0;
begin
for rec in windowcursor2
loop
v_ctr := v_ctr + 1;
delete from maintenance_window mw where mw.window_id=rec.win_id;
if (mod(v_ctr, 1000) = 0) then
commit;
end if;
end loop;
commit;
end;
/
Please consider the maintenance_mode probe release notes for important fixes:
http://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/ca-unified-infrastructure-management-probes/GA/alphabetical-probe-articles/maintenance-mode-maintenance-mode/maintenance-mode-release-notes.html
Version | Description | State | Date |
---|---|---|---|
9.02 |
What's New:
Fixed Defects:
|