Setting a timezone for new or existing Db2 deployments

You can set the advopts field to a specific timezone for your Db2 deployments.

About this task

You can add a timezone field within advopts in your YAML file to set a specific timezone for new or existing Db2 deployments. The timezone field holds a string value.

Procedure

  1. Find your Db2 cluster resource name by running the following command:
    oc get db2ucluster -n ${PROJECT_CPD_INST_OPERANDS}
  2. Set DB2_CR to the resource name of your Db2 cluster:
    export DB2_CR=<db2ucluster resource name>
  3. Patch your Red Hat® OpenShift® custom resource and set the advOpts field to the timezone you want to use:
    oc patch db2ucluster ${db2ucluster} -n ${PROJECT_CPD_INST_OPERANDS} --type merge --patch '{"spec": {
       "advOpts": {
           "timezone": "<yourTimezone>"
       }
       }}'
    Replace <yourTimezone> with the timezone you want to use in one of the following formats:
    • Abbreviation. For example: EST (Eastern timezone)
    • Continent/City. For example: Europe/Madrid
  4. Delete the Db2 pod by running the following command:
    oc delete pod $(oc get pod -n ${PROJECT_CPD_INST_OPERANDS} -l formation_id=${db2ucluster},type=engine -oname) -n ${PROJECT_CPD_INST_OPERANDS}
    The pod will be created again with updated timezone.