14.3.1 Setting Up the Scripts in the Database
To archive and purge OAA data, you must set up one time
scripts as follows:
- Enter a bash shell for the OAA management
container:
For example:kubectl exec -n <namespace> -ti <oaamgmt-pod> -- /bin/bash
kubectl exec -n oaans -ti oaamgmt-oaa-mgmt-7dfccb7cb7-lj6sv -- /bin/bash
- Inside the management container, navigate to
the
/u01/oracle/db_purge/archive
directory and login to the OAA database as aSYSDBA
user. For example:cd /u01/oracle/db_purge/archive sqlplus sys/<password>@//db.example.com:1521/orcl.example.com as sysdba
- Grant the following privileges to the OAA
schema, for example
DEV_OAA
, so that stored procedures can be created and executed:GRANT create any procedure TO <schema_name>; GRANT create any table TO <schema_name>; GRANT create any index TO <schema name>; GRANT create procedure TO <schema_name>; GRANT execute any procedure TO <schema_name>; exit;
- Login to the database as the OAA schema
user, for example
DEV_OAA
:sqlplus <schema_name>/<password>@//db.example.com:1521/orcl.example.com
- Run the
create_purge_proc.sql
script to create the purge procedures:SQL> @create_purge_proc.sql
When running thecreate_purge_proc.sql
script, the script asks for the following inputs:Enter the value for oaam_data_tbs: <schema_name>_TBS_DATA Enter the value for oaam_indx_tbs: <schema_name>_TBS_INDX
- Validate the stores procedures to make sure
they are valid and without
errors:
SELECT object_name,object_type FROM user_objects WHERE status='INVALID' and object_type='PROCEDURE';
Next steps: Running the Archive and Purge Scripts.