search cancel

Trying to clear up space on the database by lowering the SLA Data maximum days

book

Article ID: 215445

calendar_today

Updated On:

Products

iDash Workload Automation for CA 7

Issue/Introduction

Lowered the SLA Data maximum days  from 761 to 92 days for our PRD Enterprise environment in order to free up some space on our database.  
Tomcat was recycled on the server so the clean up should have taken place but the space allocation is still the same.
How can we clean up some space in the iDash database?

 

Environment

Release : 12.1

Component : CA WORKLOAD AUTOMATION iDASH FOR CA 7

Resolution

This is the query we run to do the deletions on Oracle DBs. This is set up to do batches of 10,000 runs at a time. This should deleted things older than "now minus 92 days" - which is the value inserted in both of the '?' positions in the SQL statement.

DECLARE
COUNTER INTEGER :=0;
CANT INTEGER;
BEGIN
LOOP
COUNTER := COUNTER + 1;
DELETE from idash_hist_job_run_ca7 WHERE end_time < ? AND rownum <= 10000;
SELECT COUNT(*) INTO CANT from idash_hist_job_run_ca7 WHERE end_time < ?;
exit when CANT = 0;
commit;
END LOOP;
commit;
END;

If iDash is receiving a success response on this query, as far as it knows, everything earlier than now - 92 days should be deleted.