DB2 Version 9.7 for Linux, UNIX, and Windows

SET CLIENT command

Specifies connection settings for the back-end process.

Authorization

None

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-SET CLIENT--+----------------+------------------------------->
               '-CONNECT--+-1-+-'   
                          '-2-'     

>--+-----------------------------+--+-------------------+------->
   '-DISCONNECT--+-EXPLICIT----+-'  '-SQLRULES--+-DB2-+-'   
                 +-CONDITIONAL-+                '-STD-'     
                 '-AUTOMATIC---'                            

>--+-------------------------+---------------------------------->
   '-SYNCPOINT--+-ONEPHASE-+-'   
                +-TWOPHASE-+     
                '-NONE-----'     

>--+----------------------------------------------------+------->
   '-CONNECT_DBPARTITIONNUM--+-db-partition-number----+-'   
                             '-CATALOG_DBPARTITIONNUM-'     

>--+--------------------------------------------+--------------><
   '-ATTACH_DBPARTITIONNUM--db-partition-number-'   

Command parameters

CONNECT
1
Specifies that a CONNECT statement is to be processed as a type 1 CONNECT.
2
Specifies that a CONNECT statement is to be processed as a type 2 CONNECT.
DISCONNECT
EXPLICIT
Specifies that only database connections that have been explicitly marked for release by the RELEASE statement are to be disconnected at commit.
CONDITIONAL
Specifies that the database connections that have been marked RELEASE or have no open WITH HOLD cursors are to be disconnected at commit.
AUTOMATIC
Specifies that all database connections are to be disconnected at commit.
SQLRULES
DB2
Specifies that a type 2 CONNECT is to be processed according to theDB2® rules.
STD
Specifies that a type 2 CONNECT is to be processed according to the Standard (STD) rules based on ISO/ANS SQL92.
SYNCPOINT
Specifies how commits or rollbacks are to be coordinated among multiple database connections. This command parameter is ignored and is only included here for backward compatibility.
ONEPHASE
Specifies that no transaction manager (TM) is to be used to perform a two-phase commit. A one-phase commit is to be used to commit the work done by each database in multiple database transactions.
TWOPHASE
Specifies that the TM is required to coordinate two-phase commits among those databases that support this protocol.
NONE
Specifies that no TM is to be used to perform a two-phase commit, and does not enforce single updater, multiple reader. A COMMIT is sent to each participating database. The application is responsible for recovery if any of the commits fail.
CONNECT_DBPARTITIONNUM (partitioned database environment only)
db-partition-number
Specifies the database partition to which a connect is to be made. A value between zero and 999, inclusive. Overrides the value of the environment variable DB2NODE.
CATALOG_DBPARTITIONNUM
Specifying this value permits the client to connect to the catalog database partition of the database without knowing the identity of that database partition in advance.
ATTACH_DBPARTITIONNUM db-partition-number (partitioned database environment only)
Specifies the database partition to which an attach is to be made. A value between zero and 999, inclusive. Overrides the value of the environment variable DB2NODE.

For example, if database partitions 1, 2, and 3 are defined, the client only needs to be able to access one of these database partitions. If only database partition 1 containing databases has been cataloged, and this parameter is set to 3, then the next attach attempt will result in an attachment at database partition 3, after an initial attachment at database partition 1.

Examples

To set specific values:
   db2 set client connect 2 disconnect automatic sqlrules std
      syncpoint twophase
To change SQLRULES back to DB2, but keep the other settings:
   db2 set client sqlrules db2

The connection settings revert to default values after the TERMINATE command is issued.

Usage notes

SET CLIENT cannot be issued if one or more connections are active.

If SET CLIENT is successful, the connections in the subsequent units of work will use the connection settings specified. If SET CLIENT is unsuccessful, the connection settings of the back-end process are unchanged.

In a partitioned database environment, the connection settings could have an impact on acquiring trusted connections. For example, if the CONNECT_DBPARTITIONNUM option is set to a node such that the establishment of a connection on that node requires going through an intermediate node (a hop node), it is the IP address of that intermediate node and the communication protocol used to communicate between the hop node and the connection node that are considered when evaluating this connection in order to determine whether or not it can be marked as a trusted connection. In other words, it is not the original node from which the connection was initiated that is considered. Rather, it is the hop node that is considered.

Compatibilities

For compatibility with versions earlier than Version 8:
  • The keyword CONNECT_NODE can be substituted for CONNECT_DBPARTITIONNUM.
  • The keyword CATALOG_NODE can be substituted for CATALOG_DBPARTITIONNUM.
  • The keyword ATTACH_NODE can be substituted for ATTACH_DBPARTITIONNUM.