IBM Support

Looking for a CheatSheet for cataloging DB2 Connection???

Technical Blog Post


Abstract

Looking for a CheatSheet for cataloging DB2 Connection???

Body

Ever wonder where to get a cheatsheet to catalog a connection from a DB2 client to a remote DB2 server on LUW?
Here it is with simple step-by-step instructions!!!

On the DB2 server:

1) Set the DB2COMM registry variable to tcpip.

    db2set DB2COMM=tcpip.

2) Verify whether it is set correctly using the following command:
    db2set -all
    
    Output:
    [i] DB2COMM=tcpip

3)Check the DBM CFG for SVCENAME parameter and make a note of it.
    db2 get dbm cfg
    
    For example:
    TCP/IP Service name (SVCENAME) = db2c_db2inst1
    (Either use this name (db2c_db2inst1) or find the corresponding port number from /etc/services file)

On the DB2 Client:

From the DB2 Command line:

Run the following commands:
1) Catalog the tcpip node:
    db2 catalog tcpip node <nodename> remote <Hostname or ip address of the DB2 server> server <SVCENAME or Corresponding portnumber>

    For example: db2 catalog tcpip node mynode remote myserver.lenexa.ibm.com server db2c_db2inst1
    
2) Catalog the remote DB2 database:
    db2 catalog db <dbname> as <db alias> at node <nodename>
    
    For example: db2 catalog db Sample as testsamp at node mynode
    
3) Clear the directory cache:
    db2 terminate.
    
4) To check the node and database directory.
    db2 list node directory.
    db2 list db directory.    
    
5) To test the connection:
    db2 connect to <dbalias> user <username> using <password>
    
    For example: db2 connect to testsamp user newuser using newpwd1
    
Voila!!! Now you can connect to a remote server from your DB2 Client!
    
    
    
       

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm11141966