14.47 Archiving/Unarchiving Events
This section describes how to archive/unarchive Events.
You can archive events based on your requirement. Archiving of events older than a defined period to be segmented into a separate storage area to improve performance. This is beneficial for customers who have large amounts of historical data which is still within the retention period. You can still query the data and retrieve it as needed.
There are three main archival tables:
- FCC_ARC_METADATA
- FCC_ARC_RESULTS
- FCC_ARC_AUDIT
For more information on the columns of these tables, see Archiving/Unarchiving Cases.
In the FCC_ARC_METADATA table events can be archived based on one or more column conditions (say event code (V_EVENT_CD) or event skey (N_EVENT_SKEY).
FCC_EVENTS is parent and FCC_EVENT_DETAILS is child table which are not having any foreign key. To archive event from both of these tables, V_CHILD_FLAG must be set to Y.
To unarchive, V_ROLL_BACK must be set to Y and run the Roll Back procedure.
After archival/unarchival, successful log message is displayed.
Sample Statement for Archival:
Configure the FCC_ARC_METADATA table in Atomic Schema and run the below utility with arguments given in the FCC_ARC_METADATA table to archive events in the FCC_EVENTS table:
All the child table entries that are having FOREIGN_KEY reference to this table will also get archived.
set serveroutput on;beginPKG_FCC_ARCHIVAL_COMPRESS_UTILITY.p_fcc_archival_proc('#APP_ID#','#SCHEMA_NAME#','#TABLE_NAME#');end;/
set serveroutput on;beginPKG_FCC_ARCHIVAL_COMPRESS_UTILITY.p_fcc_archival_proc('OFS_NGECM','UT_8124ATOM','FCC_EVENTS');end;/
Here:
V_APP_ID = OFS_NGECM
V_TABLE_NAME = FCC_EVENTS
V_SCHEMA_NAME = UT_8124ATOM
To view the archival data in database, execute the below command:
ALTER SESSION SET ROW ARCHIVAL VISIBILITY = ALL;
Select * from FCC_EVENTS where ORA_ARCHIVE_STATE ='1';