How to purge old historical data in CA Release Automation (RA)?
Release : 6.6, 6.7,6.8
Component : CA RELEASE AUTOMATION CORE
Below mentioned scripts for respective DB type can be executed to purge historical data for Release Automation(CARA).
Pre requisites:
Note: Refer to respective guides for details around script, tables impacted, execution etc.
Script Improvements:
Note: For Oracle scripts the script logs will be displayed at end of script execution (as per Oracle design)
Script Execution:
Disclaimer: The generic queries below is to capture records count, it is neither a recommendation/guidelines and neither liable for any technical Support from CA Release Automation Product. These are just shared as informative and should be used by user discretion.
SET SERVEROUTPUT ON
DECLARE
val NUMBER;
BEGIN
FOR I IN (SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE '%_AUD' ORDER BY TABLE_NAME) LOOP
EXECUTE IMMEDIATE 'SELECT count(*) FROM ' || i.table_name INTO val;
DBMS_OUTPUT.PUT_LINE(RPAD(i.table_name, 40, ' ') || ' ==> ' || val );
END LOOP;
END;
SELECT A.name AS TableName, SUM(B.rows) as RecordCount
FROM sys.objects A INNER JOIN sys.partitions B
ON A.object_id= B.object_id
WHERE A.type='U' AND name LIKE '%_aud'
GROUP BY A.schema_id,A.name
ORDER BY RecordCount DESC;
SET SERVEROUTPUT ON SIZE 1000000