Creating and configuring a client instance
Usually, this special type of instance is used for cataloging nodes and databases to which you want to connect using this client. Compared to server instances there are some limitations, as it cannot be started or stopped, and you cannot create databases under it. Mainly, it is used by the DB2 Client and DB2 Connect products.
Getting ready…
On nodedb22
we will create the instance owner db2clnt1
and fenced user named db2fenc1
. For creating a client instance, we'll use the –s
option of the db2icrt
command.
How to do it…
Install DB2 Client in the
/opt/ibm/db2/V9.7_clnt
location onnodedb22
, without creating an instance; to do this during installation, check at step 6—Instance setup—Defer this task until after installation is complete.Next, create users on
nodedb22
—db2clnt1
as the client instance owner anddb2fenc1
as fenced user—and set passwords identical to the usernames:[root@nodedb22 ~]# useradd -g db2iadm1 db2clnt1 [root@nodedb22 ~]# useradd -g db2fadm1 db2fenc1 [root@nodedb22 ~]# passwd db2clnt1 Changing password for user db2clnt1. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@nodedb22 ~]# passwd db2fenc1 Changing password for user db2fenc1. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@nodedb22 ~]#
As user
root
, create the client instancedb2clnt1
:[root@nodedb22 ~]# /opt/ibm/db2/V9.7/instance/db2icrt -s client -u db2fenc1 db2iclnt1 DBI1070I Program db2icrt completed successfully. [root@nodedb22 ~]#
How it works...
Mainly you need to setup a client instance when you have plans to administer DB2 servers remotely with tools that are using non-Java based connections such as Control Center or Toad for DB2. The same scenario is applicable when you are using CLI for remote administration or command execution and also in this category are non-java based application clients.
There's more...
In the previous section we used the term non-java clients. However, this not totally exact for older type JDBC or JDBC-ODBC bridge connections using type 1 and 2 drivers. Type 3 and 4 JDBC drivers have implemented internally the entire network communication stack; this is the main reason for their independence from client instances and external network libraries. A good example for a tool that is relying only on JDBC type connections is the new Optim Database Administrator recommended by IBM to be used in future for database administration.
See also
The Communication with DRDA servers (z/OS and i/OS) recipe in Chapter 11, Connectivity and Networking