Table of contents

UPDATE DATABASE CONFIGURATION command

The UPDATE DATABASE CONFIGURATION command modifies individual entries in a specific database configuration file. A database configuration file resides on every database partition on which the database has been created.

Scope

This command updates all database partitions or members by default, except when the following optional clause is specified:
  • MEMBER to update only one database member for a Db2® pureScale® environment, or to update only one database partition in a partitioned database environment.

Authorization

One of the following authorities:
  • SYSADM
  • SYSCTRL
  • SYSMAINT

Required connection

Instance. An explicit attachment is not required, but a database connection is recommended when the database is active. If the database is listed as remote, an instance attachment to the remote node is established for the duration of the command. To change a parameter online, you must be connected to the database.

Command syntax

Read syntax diagramSkip visual syntax diagramUPDATEDATABASEDBCONFIGURATIONCONFIGCFGFORdatabase-aliasMEMBERmember-numberUSING config-keywordvaluevalueAUTOMATICAUTOMATICMANUAL IMMEDIATEDEFERRED

Command parameters

FOR database-alias
Specifies the alias of the database whose configuration is to be updated. Specifying the database alias is not required when a database connection has already been established. You can update the configuration file for another database residing under the same database instance. For example, if you are connected only to database db11, and issue update db config for alias db22 using .... immediate:
  • If there is no active connection on db22, the update will be successful because only the configuration file needs to be updated. A new connection (which will activate the database) will see the new change in memory.
  • If there are active connections on db22 from other applications, the update will work on disk but not in memory. You will receive a warning saying that the database needs to be restarted.
MEMBER member-number
The MEMBER clause specifies to which member the change should be applied. Omission of this clause results in the change being applied to all the members.
USING config-keyword value
config-keyword specifies the database configuration parameter to be updated. value specifies the value to be assigned to the parameter.
AUTOMATIC
Some configuration parameters can be set to AUTOMATIC, allowing Db2 database systems to automatically adjust these parameters to reflect the current resource requirements. For a list of configuration parameters that support the AUTOMATIC keyword, refer to the configuration parameters summary. If a value is specified along with the AUTOMATIC keyword, it might influence the automatic calculations. For specific details about this behavior, refer to the documentation for the configuration parameter.
MANUAL
Disables automatic tuning for the configuration parameter. The parameter is set to its current internal value and is no longer updated automatically.
IMMEDIATE
Make the changes immediately, while the database is running. IMMEDIATE is the default action, but it requires a database connection to be effective.

This is a default clause when operating in the CLPPlus interface as well. IMMEDIATE need not be called when using CLPPlus processor.

DEFERRED
Make the changes only in the configuration file, so that the changes take effect the next time you reactivate the database.

Examples

Update database configuration on a multi-partition instance

This example demonstrates how to update database configuration parameter MAXAPPLS from 10 to 50 for a database named SAMPLE.

A user has a multi-partition instance that has 4 partitions as defined in the db2nodes.cfg:
10 gilera 0
20 gilera 1
30 motobi 0
40 motobi 1 

The user has created the SAMPLE database on the instance. The catalog partition for SAMPLE is on member 10. Let us assume the user is logged on to system motobi.

Since the default behavior for a multi-partition instance is to update the database configurations on all database partitions, the following command issued by users will result in the same value for MAXAPPLS across all database partitions:
db2 update db cfg for sample using maxappls 50
To update MAXAPPLS only on member 30, the following commands may be issued:
db2 update db cfg for sample member 30 using maxappls 50

Usage notes

To view or print a list of the database configuration parameters, use the GET DATABASE CONFIGURATION command.

To reset all the database configuration parameters to the recommended defaults, use the RESET DATABASE CONFIGURATION command.

To change a database configuration parameter, use the UPDATE DATABASE CONFIGURATION command. For example, to change the logging mode to archival logging on a single-partition database environment containing a database called ZELLMART, use:

db2 update db cfg for zellmart using logarchmeth1 logretain

To check that the logarchmeth1 configuration parameter has changed, use:

db2 get db cfg for zellmart

For example, to change the logging mode to archival logging on all partitions (provided the registry variable DB2_UPDDBCFG_SINGLE_DBPARTITION is set, by default, to NULL or FALSE) in a multiple-partitioned database environment containing a database called zellmart, use:

db2 update db cfg for zellmart using logarchmeth1 logretain

To check that the logarchmeth1 configuration parameter has changed on all database partitions, use:

db2_all ";db2 get db cfg for zellmart"
Using the previous example, but to update the logging mode to only one specific partition (30), use:
db2 update db cfg for zellmart member 30 using logarchmeth1 logretain

Optionally, you can leverage the SYSIBMADM.DBCFG view to get data from all partitions without having to use db2_all.

If you are working on a UNIX operating system, and you have the grep command, you can use the following command to view only the logarchmeth1 values:

db2_all ";db2 get db cfg for zellmart | grep -i logarchmeth1"

For more information about Db2 database configuration parameters and the values available for each type of database node, see the individual configuration parameter descriptions. The values of these parameters differ for each type of database node configured (server, client, or server with remote clients).

Not all parameters can be updated.

Some changes to the database configuration file become effective only after they are loaded into memory. All applications must disconnect from the database before this can occur. For more information aboutwhich parameters are configurable online and which ones are not, see summary list of configuration parameters.

For example, to change the sortheap database configuration parameter online for the SALES database, enter the following commands:
db2 connect to sales 
db2 update db cfg using sortheap 1000 
db2 connect reset

If an error occurs, the database configuration file does not change. The database configuration file cannot be updated if the checksum is invalid. This might occur if the database configuration file is changed without using the appropriate command. If this happens, the database must be restored to reset the database configuration file.

Compatibilities

For compatibility with previous versions:
  • DBPARTITIONNUM can be substituted for MEMBER, except when the DB2_ENFORCE_MEMBER_SYNTAX registry variable is set to ON.