procedure runs the Oracle partition exchange logic for the archive job when the job deletes from the source. When you configure the entity steps, you add the procedure for the delete from source step. A single call to the procedure processes the partition exchange for all tables.
When the archive job calls the procedure, the procedure performs the following steps for each table that is configured for partition exchange:
The procedure creates a keep table in the staging user. The keep table contains all records from the source table that are not flagged for archiving. The run procedure uses the following naming convention to create the keep table:
<table name>_KEEP
The procedure adds records to the keep table. To determine which records to add, the procedure subtracts the records in the staging table from the source table. The remaining records are not included in the archive job and should remain in the source.
The procedure invokes the Oracle partition exchange feature to swap the segments from the source table with the segments from the keep table.
The procedure rebuilds the source table indexes.
The procedure drops the keep table.
The procedure performs the steps for one source table at a time. After the procedure processes the first source table, the procedure performs the cycle again for the next source table. If the source table includes multiple partitions, then the procedure performs the steps for one partition at a time.