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.
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.
>>-UPDATE--+-DATABASE-+--+-CONFIGURATION-+----------------------> '-DB-------' +-CONFIG--------+ '-CFG-----------' >--+---------------------+--+-----------------------+-----------> '-FOR--database-alias-' '-MEMBER--member-number-' .--------------------------------------. V | >--USING----config-keyword--+-value------------+-+--------------> +-value--AUTOMATIC-+ +-AUTOMATIC--------+ '-MANUAL-----------' .-IMMEDIATE-. >--+-----------+----------------------------------------------->< '-DEFERRED--'
This is a default clause when operating in the CLPPlus interface as well. IMMEDIATE need not be called when using CLPPlus processor.
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.
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.
db2 update db cfg for sample using maxappls 50
db2 update db cfg for sample member 30 using maxappls 50
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"
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.
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.