DB2 Version 9.7 for Linux, UNIX, and Windows

db2set - DB2 profile registry command

Displays, sets, or removes DB2® profile variables. An external environment registry command that supports local and remote administration, via the DB2 Administration Server, of DB2's environment variables stored in the DB2 profile registry.

Authorization

sysadm

For the -g command parameter, root access on Linux and UNIX systems or Local Administrator on Windows operating systems is required.

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-db2set--+----------------------+----------------------------->
           '-variable=--+-------+-'   
                        '-value-'     

>--+----------------------------------------+--+-------+-------->
   +- -g------------------------------------+  '- -all-'   
   +- -i--instance--+---------------------+-+              
   |                +-db-partition-number-+ |              
   |                '-member_number-------' |              
   '- -gl-----------------------------------'              

>--+-----------------------------+--+--------+------------------>
   '- -gd--agg-registry-variable-'  '- -null-'   

>--+--------------------------------------------+--------------->
   '- -r--+----------+--+---------------------+-'   
          '-instance-'  +-db-partition-number-+     
                        '-member_number-------'     

>--+-------------------------------------------------+---------->
   '- -n--DAS node--+------------------------------+-'   
                    '- -u--user--+---------------+-'     
                                 '- -p--password-'       

>--+------+--+-----+--+------+--+-----+------------------------><
   +- -l--+  '- -v-'  +- -ul-+  +- -h-+   
   '- -lr-'           '- -ur-'  '- -?-'   

Command parameters

variable=
Displays the specified variable's value.
value
Sets the specified variable to the entered value. If value has space(s), make sure to enclose the value in quotes. To delete a variable, do not specify a value for the specified variable after the equal sign (=). Changes to settings take effect after the instance has been restarted.
-g
Accesses the global profile registry variables for all instances pertaining to a particular DB2 copy.
-i instance
Specifies the instance profile to use instead of the current, or default.
db-partition-number or member-number
Specifies a number listed in the db2nodes.cfg file.
-gl
Accesses the global profile variables stored in LDAP. This option is only effective if the registry variable DB2_ENABLE_LDAP has been set to YES.
-all
Displays all occurrences of the local environment variables as defined in:
  • The environment, denoted by [e]
  • The node level registry, denoted by [n]
  • The instance level registry, denoted by [i]
  • The global level registry, denoted by [g].
-gd agg-registry-variable
Displays the group definition of an aggregate registry variable. For additional information, see "Aggregate registry variables" in the Related links section.
-null
Sets the value of the variable at the specified registry level to NULL. This avoids having to look up the value in the next registry level, as defined by the search order.
-r
Resets the profile registry for the given instance.
instance
If no instance is specified, and an instance attachment exists, resets the profile for the current instance. If no instance is specified, and no attachment exists, resets the profile for the instance specified by the DB2INSTANCE environment variable.
db-partition-number or member-number
Specifies a number listed in the db2nodes.cfg file.
-n DAS node
Specifies the remote DB2 administration server node name.
-u user
Specifies the user ID to use for the administration server attachment.
-p password
Specifies the password to use for the administration server attachment.
-l
Lists all instance profiles for the current DB2 product installation.
-lr
Lists all supported registry variables.
-v
Specifies that verbose output is to be used while the command is running.
-ul
Accesses the user profile variables. This parameter is supported on Windows operating systems only.
-ur
Refreshes the user profile variables. This parameter is supported on Windows operating systems only.
-h | -?
Displays help information. When this option is specified, all other options are ignored, and only the help information is displayed.

Examples

Usage notes

If no variable name is specified, the values of all defined variables are displayed. If a variable name is specified, only the value of that variable is displayed. To display all the defined values of a variable, specify variable -all. To display all the defined variables in all registries, specify -all.

To modify the value of a variable, specify variable=, followed by its new value. To set the value of a variable to NULL, specify variable -null. Changes to settings take effect after the instance has been restarted.

To delete a variable, specify variable=, followed by no value.

Although the command behaves the same for non-root installations of DB2, not all parameters are available, such as the one specifying the DAS node name.

User-level registry variables are supported only on Windows operating systems running in an LDAP environment. Variable settings at the user level are specific to each user. Changes to the user-level registry profile are written to the LDAP directory.

Some variables, such as the DB2SYSTEM system environment variable and the DB2INSTDEF general registry variable, can be set only at the global level.

To ensure that changes to a variable in a particular profile registry do not affect your database environment, set that variable in a registry that overrides the registry that you want to restrict. For example, to ensure that changes to a variable in the global-level profile do not affect your database environment, set that variable in the instance-level profile. In this example, changes to the variable in the instance node-level profile still affect your database environment because the instance node-level profile overrides the instance-level profile. If you do not want to set a specific value for a variable, you can set the variable to NULL.

The db2set command must not be run concurrently or continuously in a script.