Condition
When you enable audit logging and set archiveToDb to true,
audit stores loaded images after the LOAD task is finished. Keeping these images takes a large
amount of disk space in the
/mnt/bludata0/db2/copy or /mnt/bludata0/scratch/db2/copy
paths. Also AUDIT.* tables display repetitive logs.
Workaround
You must set archiveToDb to false when
enabling
audit.
Procedure
- Update the
db2ucluster
CR:
- Find your
db2ucluster
resource
name:oc get db2ucluster -n ${PROJECT_CPD_INST_OPERANDS}
- Update your
db2ucluster
resource:oc edit db2ucluster <db2u_cluster_name> -n ${PROJECT_CPD_INST_OPERANDS} -o yaml
Ensure
you have archiveToDb set to false, for
example:
spec:
addOns:
audit:
archiveToDb: false
- Update Audit setups and stored procedure inside container:
- Select your deployment by running the following
command:
oc -n ${PROJECT_CPD_INST_OPERANDS} exec -it ${db2_podname} -- bash
- Switch to the
db2inst1
profile:su - db2inst1
- Update Audit setup with
--archive-to-db
:python3 /db2u/script/installaudit.py --archive-to-db false