Purge Aged Sales History (history_purge_job)
Module Name |
history_purge_job |
Description |
Purge Aged Sales History |
Functional Area |
Sales Posting |
Module Type |
Admin - Ad hoc |
Module Technology |
Background Processing |
Catalog ID |
N/A |
Wrapper Script |
b8dwrap.ksh |
Design Overview
This background job is composed of two steps processing. It will have a threading assignment and a business logic processing.
Thread assignment program will filter eligible records from department, class, subclass sales history tables based on its purge criteria from system parameter settings. The Item History Months parameter will determine record which is older than the specific number of retention months of fashion style history. These records are chunked and Thread ID is assigned for each. They will be stored temporarily in a staging table.
The Business logic program will process all records from the staging table. Using bulk processing, this program will delete the records from sales history tables by department, class and subclass tables. It will also invoke a call to a new program specific for handling historical tables that are considered partitioned tables. PARTITION_SQL.PURGE_INTERVAL_PARTITION is called passing each target table names "ITEM_LOC_HIST", "ITEM_LOC_HIST_MTH", and "DAILY_SALES_DISCOUNT". This called program will execute the proper deletion/purging of records from target table by exercising table partitioning handling such as Dropping Interval Partition (same as truncate or delete from table). There is a STOP ON NEXT feature in bulk processing (through a loop) where Administrators can stop this batch with a flip of this indicator.
The decision to insert or not to insert the records into the history tables is based on the Archive Indicator and Archive Job Indicator from the Background Process Configuration table.
-
If both the Archive Indicator and Archive Job Indicator values are
Y
, then the data from the base tables are inserted into the history tables. -
If both indicators are set to
N
, then the records are deleted from the base tables without inserting into the history tables.
Note:
For more information on how to configure this process for archiving, see the Merchandising Implementation Guide section entitled “Background Process Configuration”.
Key Tables Affected
Table 15-1 Key Tables Affected
Table | Select | Insert | Update | Delete |
---|---|---|---|---|
PERIOD |
Yes |
No |
No |
No |
PURGE_CONFIG_OPTIONS |
Yes |
No |
No |
No |
SYSTEM_OPTIONS |
Yes |
No |
No |
No |
RMS_BATCH_STATUS |
Yes |
No |
No |
No |
B8D_PROCESS_CONFIG |
Yes |
No |
No |
No |
JOB_AUDIT_LOGS |
No |
Yes |
No |
No |
B8D_HIST_PURGE_STG |
Yes |
Yes |
No |
Yes |
ALL_PART_TABLES |
Yes |
No |
No |
No |
ALL_TAB_PARTITIONS |
Yes |
No |
No |
No |
ITEM_LOC_HIST |
No |
No |
No |
Yes |
ITEM_LOC_HIST_MTH |
No |
No |
No |
Yes |
SUBCLASS_SALES_HIST |
No |
No |
No |
Yes |
CLASS_SALES_HIST |
No |
No |
No |
Yes |
DEPT_SALES_HIST |
No |
No |
No |
Yes |
DAILY_SALES_DISCOUNT |
No |
No |
No |
Yes |
DAILY_SALES_DISCOUNT_PRG_HIST |
No |
Yes |
No |
No |
ITEM_LOC_HIST_PRG_HIST |
No |
Yes |
No |
No |