Changing Db2 or Db2 Warehouse Configuration Settings
You can configure Db2 or Db2 Warehouse configuration settings during Db2uInstance custom resource creation. After deployment, you must use native Db2 commands to change these settings.
You can configure the following settings:
- Database configuration parameters (db cfg)
- Database manager configuration parameters (dbm cfg)
- Registry and environment variables (db2set)
Configuration parameters after deployment
After a Db2 or Db2 Warehouse instance is deployed, changes to database (db cfg) and database manager (dbm cfg) configuration parameters are not supported through updates to the Db2uInstance custom resource (CR).
The Db2uInstance admission webhook validates the CR and ensures that modifications to
dbConfig and dbmConfig are only applied during resource creation.
Any updates to these parameters after deployment must be performed using native Db2 commands.
To modify configuration settings after deployment, use native Db2 commands as described in the following documentation:
- UPDATE DATABASE MANAGER CONFIGURATION command
- UPDATE DATABASE CONFIGURATION command
- Setting registry and environment variables
- ADMIN_CMD procedure - Run administrative commands
Configuration changes that are not applied immediately take effect during the next maintenance window. If required, changes can be applied sooner by restarting Db2 using one of the following procedures:: Shutting down and restarting Db2 or Db2 Warehouse custom resources or Stopping and starting a Db2 or Db2 Warehouse instance.
Initial configuration during CR creation
You can specify initial configuration values in the Db2uInstance custom resource during deployment.
Database configuration parameters
Database configuration parameters are found under the yaml path
spec.environment.databases.dbConfig. Each database has a list under the key
databases with its own unique name.
Under the key dbConfig, you can add a key-value pair. Values must be enclosed in quotation marks. For example, setting the parameter LOGPRIMARY to 50 for the database BLUDB would look like so:
spec:
environment:
databases:
- dbConfig:
LOGPRIMARY: "50"
name: BLUDB
For more information on the parameters, see Database configuration parameters in the Db2 documentation.
Database manager configuration parameters
Database manager configuration parameters are found under the yaml path
spec.environment.instance.dbmConfig.
Under the key dbmConfig, you can add a key-value pair. Values must be enclosed in quotation marks. For example, setting the parameter DIAGSIZE to 50 would look like so:
spec:
environment:
instance:
dbmConfig:
DIAGSIZE: "100"
For more information on the parameters, see Database manager configuration parameters in Db2 documentation.
Registry and environment variables
Registry configuration parameters are found under the yaml path
spec.environment.instance.registry.
Under the key registry, you can add a key-value pair. Values must be enclosed in quotation marks. For example, setting the parameter DB2_DISPATCHER_PEEKTIMEOUT to 5 would look like so:
spec:
environment:
instance:
registry:
DB2_DISPATCHER_PEEKTIMEOUT: "5"
For more information on the parameters, see Registry and environment variables in Db2 or Db2 Warehouse documentation.