Disabling the ArchiveToDb parameter to prevent storage issue

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

  1. Update the db2ucluster CR:
    1. Find your db2ucluster resource name:
      oc get db2ucluster -n ${PROJECT_CPD_INST_OPERANDS}
    2. 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
  2. Update Audit setups and stored procedure inside container:
    1. Select your deployment by running the following command:
      oc -n ${PROJECT_CPD_INST_OPERANDS} exec -it ${db2_podname} -- bash
    2. Switch to the db2inst1 profile:
      su - db2inst1
    3. Update Audit setup with --archive-to-db:
      python3 /db2u/script/installaudit.py --archive-to-db false