1 Common usage
Show all defined configuration files (DB2 instances) related to a particular installation:
db2set -l
Show all supported registry variables:
db2set -lr
Show all visible instances of global variables associated with a particular device:
db2set -g
Show all defined variables of the current instance:
db2set
Display all defined values for the current instance:
db2set -all
Display all defined values of DB2COMM for the current instance:
db2set -all DB2COMM
Reset all defined variables for instance INST on node 3:
db2set -r -i INST 3
Unset the variable DB2CHKPTR on the remote instance RMTINST via the DAS node RMTDAS, using user ID MYID and password MYPASSD:
db2set -i RMTINST -n RMTDAS -u MYID -p MYPASSWD DB2CHKPTR=
Set the variable DB2COMM to global TCPIP for all instances related to a particular installation:
db2set -g DB2COMM=TCPIP
For example, to set the variable DB2COMM to only TCPIP MYINST:
db2set -i MYINST DB2COMM=TCPIP
Set the variable DB2COMM to null at the given instance level: �
db2set -null DB2COMM
Set the registry variable to a value that contains spaces by enclosing the value in quotes:
db2set DB2_LOAD_COPY_NO_OVERRIDE='COPY YES TO /var/db2/loadcopy/sales'
2 Essence usage
2.1 How to modify global variables
For example, environment variables such as DB2SYSTEM=hostname, these parameters can only be modified from root.
1、使用root登陆
# su - root
#
2、进入安装目录
# cd /opt/IBM/V9.7/adm
# ./db2set DB2SYSTEM=hostname
Other relevant information:
The modification of the host name needs to be modified as follows:
1. Modify /etc/hosts
2. Modify /home/db2inst1/sqllib/db2node.cfg
3. Modify DB2SYSTEM=hostname
4. Rebuild the mutual trust file.