Step 1: Take Table Counts Before Purging Before performing any purge, get the record counts of the affected tables to ensure you can verify the archival later. Affected Tables: WSH_TRIPS WSH_TRIP_STOPS WSH_DELIVERY_LEGS WSH_NEW_DELIVERIES WSH_DELIVERY_DETAILS WSH_DELIVERY_ASSIGNMENTS SQL statement: SELECT COUNT(*) FROM WSH_TRIPS; SELECT COUNT(*) FROM WSH_TRIP_STOPS; SELECT COUNT(*) FROM WSH_DELIVERY_LEGS; SELECT COUNT(*) FROM WSH_NEW_DELIVERIES; SELECT COUNT(*) FROM WSH_DELIVERY_DETAILS; SELECT COUNT(*) FROM WSH_DELIVERY_ASSIGNMENTS; Step 2: Configure Archival Setup Insert configuration metadata into a custom configuration table XXXX ARCHIVE_CONFIG_TBL. SQL statement: INSERT INTO XXXX_ARCHIVE_CONFIG_TBL (SNO, MODULE_SHORT_NAME, MODULE_LONG_NAME, ARCHIVE_REQUIRED, ORIG_TABLE_NAME, ARCHIVE_TABLE_NAME, LAST_ARCHIVED_ON) VALUES (XXXX_ARCHIVE_SEQ.NEXTVAL, ‘WSH’, ‘SHIPPING’, ‘Y’, ‘WSH_TRIP_STOPS’, ‘XXXX_WSH_TRIP_STOPS_ARCHIVE’, SYSDATE) (SNO, MODULE_SHORT_NAME, MODULE_LONG_NAME, ARCHIVE_REQUIRED, ORIG_TABLE_NAME, ARCHIVE_TABLE_NAME, LAST_ARCHIVED_ON) VALUES (XXXX_ARCHIVE_SEQ.NEXTVAL, ‘WSH’, ‘SHIPPING’, ‘Y’, ‘WSH_TRIPS’, ‘XXXX_WSH_TRIPS_ARCHIVE’, SYSDATE) (SNO, MODULE_SHORT_NAME, MODULE_LONG_NAME, ARCHIVE_REQUIRED, ORIG_TABLE_NAME, ARCHIVE_TABLE_NAME, LAST_ARCHIVED_ON) VALUES (XXXX_ARCHIVE_SEQ.NEXTVAL, ‘WSH’, ‘SHIPPING’, ‘Y’, ‘WSH_DELIVERY_LEGS’, ‘XXXX_WSH_’WSH_DELIVERY_LEGS _ARCHIVE’, SYSDATE) (SNO, MODULE_SHORT_NAME, MODULE_LONG_NAME, ARCHIVE_REQUIRED, ORIG_TABLE_NAME, ARCHIVE_TABLE_NAME, LAST_ARCHIVED_ON) VALUES (XXXX_ARCHIVE_SEQ.NEXTVAL, ‘WSH’, ‘SHIPPING’, ‘Y’, ‘WSH_DELIVERY_DETAILS’, ‘XXXX_WSH_’WSH_DELIVERY_DETAILS’_ARCHIVE’, SYSDATE)…
Read More