Вы находитесь на странице: 1из 4

3/19/2020 Connecting from the DB2 LUW Client to the iSeries/zSeries database server using the command line

g the command line processor

IBM Offerings My support  Downloads  Documents  Cases 

Communities  Training  Other 

IBM Support
Search support or find a product 

Connecting from the DB2 LUW Client to the iSeries/zSeries database s


line processor

Contact and feedback


Question & Answer

Question
This technote describes how to configure a connection from a DB2 data server client to a remote database o
using the command line processor (CLP).

Answer
Before you begin

· You must have installed IBM® DB2 Connect™ Server Product


· Ensure you have access to User ID details for cataloging database entries
· Verify the Connect Server product is installed in your System

(Unix)
/usr/local/bin/db2ls -q -b <installpath> -p .

Example:
/usr/local/bin/db2ls -q -b /opt/ibm/db2/v9.7 -p

Product Response File ID Level Fix Pack Product Description


-----------------------------------------------------------------------------
CONNECT_SERVER 9.7.0.3 3 DB2 Connect Server
https://www.ibm.com/support/pages/connecting-db2-luw-client-iserieszseries-database-server-using-command-line-processor 1/4
3/19/2020 Connecting from the DB2 LUW Client to the iSeries/zSeries database server using the command line processor

IBM Offerings My support  Downloads  Documents  Cases 


(Windows)

Communities  Training  Other 


E:\>db2unins -d
The DB2 copy with the name "DB2COPY1" contains the following products:
DB2 Connect Server

Note 1:

DB2 Connect is a combination of application interfaces (APIs) and network infrastructure


components that allow one to make SQL request on a Windows ,Linux or Unix machines against
databases running on IBM System z(mainframe) and System i(AS/400). In other words, the data
reside on the mainframe while application code that uses the data is deployed to distributed system.
like, say a Windows laptop or a server. It uses a three tier connection to connect client to iSeries/zSeries

Contact and feedback


database.

Note 2:

If you have DB2 Enterprise Server edition installed in your system, then you don't require to install DB2 CO

Procedure

1. Create the node.


Add the TCP/IP node (iSeries/zSeries server) entry to the DB2 client node(LUW) .

Node name - It is nickname of the host that has database you want to catalog.
Hostname/IP address - It is the name/IP address of the iSeries/zSeries box
servicename/port number - It is the Service name/Port number of the DB2 database manager .

db2 catalog tcpip node <nodename> remote <IP adress> server <portnumber>

Example :

db2 catalog tcpip node vmnode remote 9.26.89.8 server 446

2. Catalog the database in System database directory


This command stores the database location information in System database directory
https://www.ibm.com/support/pages/connecting-db2-luw-client-iserieszseries-database-server-using-command-line-processor 2/4
3/19/2020 Connecting from the DB2 LUW Client to the iSeries/zSeries database server using the command line processor

IBM Offerings My support  Downloads  Documents  Cases 


databasename - Identifies the name of the database that is to be cataloged
alias - Identifies the alias that is assigned to database when it is cataloged
Communities  Training  Other 

db2 catalog db <databasename> as <alias> at node <nodename> authentication dcs

Example:

db2 catalog db SQLMDAY5 as vmdb at node vmnode authentication dcs

3. Catalog the database in Database Connection services directory


This command stores information about iSeries/zSeries database in DCS
(Database Connection Services) directory.

Contact and feedback


localdatabasename - Identifies the alias of target database to be cataloged. This name should
match entry in system database directory associated with remote node
Targetdatabase - Identifies the name of iSeries /zSeries database to be cataloged

This command stores information about iSeries/zSeries database in DCS(Database Connection Services) dir

db2 catalogs dcs db <localdatabasename> as <targetdatabasename>

Example:

db2 catalog dcs db vmdb as SQLMDAY5

4. Connect to the database


This command established database connection

databasename - Identifies the name of the database you want to connect to


username - Identifies the userid assigned to the user attempting to establish a database connection
password - Identifies the password assigned to the user attempting to establish a database connection

db2 connect to <databasename> user <username> using <password>

Example:

db2 connect to vmdb user sqldba using sqldbapw

https://www.ibm.com/support/pages/connecting-db2-luw-client-iserieszseries-database-server-using-command-line-processor 3/4
3/19/2020 Connecting from the DB2 LUW Client to the iSeries/zSeries database server using the command line processor

IBM Offerings My support  Downloads  Documents  Cases 


Document Information
More support for: Communities  Training  Other 
DB2 for Linux- UNIX and Windows

Component:
Connectivity - DRDA

Software version:
9.7, 9.5, 9.1

Operating system(s):
AIX; HP-UX; Linux; Solaris

Software edition:
Enterprise Server, Express, Workgroup Server

Contact and feedback


Document number:
408611

Modified date:
16 June 2018

https://www.ibm.com/support/pages/connecting-db2-luw-client-iserieszseries-database-server-using-command-line-processor 4/4

Вам также может понравиться