Archive and Truncate Purge History Tables (batch_archive_purge_hist.ksh)
Module Name |
batch_archive_purge_hist.ksh |
Description |
Archive and Truncate Purge History Tables |
Functional Area |
Administration |
Module Type |
Admin |
Module Technology |
ksh |
Catalog ID |
RMS477 |
Wrapper Script |
N/A |
Design Overview
The purpose of this program is to archive and truncate purge history tables regularly in Merchandising.
When you 'delete' a record in the Merchandising user interface, information is generally not immediately deleted at the database level; instead, data is marked as being in deleted status and also inserted into the DAILY_PURGE table. Next the purge processes will delete the data from Merchandising transaction tables. Before deleting data from these tables, transaction data will be archived by inserting into purge history tables by the transaction purge processes.
The batch_archive_purge_hist.ksh will export the purge history table data as a dump file using Oracle Data Pump export utility (expdp) and move the dump file to SFTP site for customer pick up. And after successful export of the transaction data, purge history tables are truncated.
This script has the below functions:
-
check_archive_dates - checks for the archive last run date. Based on the last archive date and the archive frequency input parameter, decides whether to archive and truncate the purge history tables or not. This ensures that even though this batch job is scheduled to run daily, the actual archiving and purging of the purge history tables will only occur every X number of days based on the input parameter.
-
truncate_prg_hist_tables - Truncates purge history tables after successful export of the transaction data.
-
update_rms_archive_date - update the Merchandising archive date, after the successful archiving and truncation of purge history tables.