History Tables
Archiving to history tables involves using tables that you create for the sole purpose of storing archived data. You must determine whether the archived data should be stored in the history tables temporarily or on a long-term basis.
By definition, history tables are identical copies of the online tables. However, history records must include PSARCHIVE_SBR sub-record that contains the archive ID and batch number. Some PeopleSoft applications deliver history tables prebuilt for use in common archiving processes. If you design a custom archiving scheme, you need to create the history tables using Application Designer.
History Table Considerations
After the archive process moves the data into the history table, the data resides in both the online tables and in the history table; you then have two options:
-
Deleting the archived data from the online tables.
-
Leaving the archived rows in the online tables such that the data exists in parallel.
Building History Tables
Before you run the archiving process, you must first create (or build) the history tables.
You must build one history table for each table to be archived. The history table must be identical to the archive table. PeopleSoft Data Archive Manager uses the PSARCHIVE_SBR sub-record that contains PSARCH_ID and PSARCH_BATCHNUM to denote when a piece of data was archived and to uniquely identify it.
The following example uses the record JRNL_HEADER.
To build a history table:
-
Open Application Designer.
-
Open the JRNL_HEADER table.
-
Select File, Save As and name the history table with an appropriate name, such as JRNL_HEADER_HST.
-
When prompted to copy the PeopleCode associated with the table, click No.
-
Select Insert, Sub-Record, and then insert the PSARCHIVE_SBR sub-record.
-
Save the record.
-
Build the table by selecting Build, Current Object.
-
Select the following build options: Create Tables and Create Indexes.
-
Select the following build execute option: Execute and build script.
-
Click Build.
-