14.3.2 Running the Archive and Purge Scripts

To run the archive and purge scripts, proceed as follows:
  1. If you are not already inside the mangement container, enter a bash shell for it:
    kubectl exec -n <namespace> -ti <oaamgmt-pod> -- /bin/bash
    For example:
    kubectl exec -n oaans -ti oaamgmt-oaa-mgmt-7dfccb7cb7-lj6sv -- /bin/bash
  2. Inside the management container, navigate to the /u01/oracle/db_purge/archive directory:
    cd /u01/oracle/db_purge/archive
  3. Select the scripts to run based on the data that must be archived or purged. The table below lists the types of data and corresponding script name:

    Table 14-1 Archive and Purge Scripts Based on Types of Data

    Type of Data Corresponding Script Description/Comments
    User Authentication related data exec_sp_purge_tracker_data.sql All OAA/OARM/OUA user authentication activity generates this type of data.
    Rules, Policy Log Data exec_sp_purge_rule_log.sql All OAA/OARM user authentication activity generates this type of data.
    Custom Activities related Data exec_sp_purge_txn_log.sql If product is configured to use custom activities then, it generates this type of data.
    Behavior pattern related Pattern Data exec_sp_purge_workflow_data.sql If product is configured to use profiling / patterns, then it generates this type of data.
    User Authentication Profile Data exec_sp_purge_profile_data.sql All OAA/OARM/OUA user authentication activity generates this type of data.
    Data generated from Monitor data points exec_v_monitor_purge_proc.sql All OAA/OARM user authentication activity generates this type of data.
  4. Edit the sql script you want to run. Set the p_days1 and p_archived parameters accordingly. In cases where the sql script prompts for p_days1 and/or p_archived then there is no need to edit the sql script before running. The table below describes these parameters:

    Table 14-2 Archive and Purge Routine Parameters

    Variable Name Default Value Description
    p_days1 180 Retention period in days. Data older than this many number of days will be archived or purged.
    p_archived Y Y or N for Yes and No respectively. If "Y" then data will be archived (in archive tables), otherwise data will be purged based on the retention period.
  5. Login to the database as the OAA schema user, for example DEV_OAA and execute the selected script:
    sqlplus <schema_name>/<password>@//db.example.com:1521/orcl.example.com
    SQLPLUS> @<script>.sql
  6. Check the corresponding log file and see if there are any errors or warnings.
  7. If archiving is selected, then make sure to take a backup of the archive tables so that data can be restored if needed.

Next steps: Running Partition Maintenance Scripts.