zSeries DB2 Connect Preparation

 

While no software needs to be installed on your z/OS system to allow DB2 Connect to connect to the DB2 Server, there is some information that must be gathered and a few items to configure.  Most of this information is contained in the DB2 Connect User’s Guide, but I will present it in a somewhat different way here.  Thank you to Jeff Sullivan who provided the bulk of this information to me.

 

 

Preparations needed on DB2zOS

 

  1. The Distributed Data Facility (DDF) must be started on the z/OS system to allow DB2 Connect connections.  If it is not started then you must start it before DB2 connect can be used.

 

  1. You must create or find a user id on z/OS that has at least "BINDADD" and "CREATE IN COLLECTION NULLID" authorities.  A user with “SYSADM” or “SYSCTRL” will also work.  This is needed to run the bind commands that bind the DB2 Client queries to the database.

 

  1. The firewall and z/OS system must open the TCP/IP port (described below) for connections from the DB2 Connect server(s).

 

 

 

DB2 for z/OS Information to Gather

 

To configure the DB2 Connect servers to connect to DB2/zOS, you must gather certain information from the z/OS system.  I will only cover TC/IP connections in this article.  The three pieces of information that you need from the z/OS system are the IP address or Host Name, the port on which DB2 is listening on connections, and the database name to which you want to connect.  I expand on where to find these in the next two sections.  Finally I provide the syntax of the basic “CATALOG” commands where you use this information to configure your DB2 Connect servers.

 

 

TCP/IP remote hostname or IP address

 

When defining a TCP/IP node on the DB2 Connect server you need either the remote TCP/IP hostname, or the remote TCP/IP address of the z/OS system running DB2. If a hostname is specified, then it must be resolved at the DB2 Connect workstation, either through Domain Name Server (DNS) lookup, or by an entry in the local TCP/IP hosts file.

 

For DB2® for OS/390® and z/OS® remote hosts, the hostname appears in the DSNL004I message (DOMAIN=hostname) when the Distributed Data Facility (DDF) is started. The -DISplay DDF command could also be used.

 

If accessing a z/OS data sharing group, the domain name should map to the DB2 group dynamic VIPA (Virtual IP Address). This address routes to the least loaded DB2 member. To access a specific member use the specific DB2 member dynamic VIPA address and turn off sysplex routing. Each member DSNL004I message displays the member specific domain name.

 

TCP/IP service name or port number

 

When defining a TCP/IP node on the DB2 Connect server you need either the remote TCP/IP service name or port number on which DB2 on z/OS is listening. This must be defined to TCP/IP at the remote host. Port number 446 has been registered as the default port number for DRDA.  It is possible that your system is listening on a port other than the default though.

 

For DB2 for OS/390 and z/OS remote hosts, the port number is defined in the Boot Strap Data Set (BSDS) as PORT and is also provided in the DSNL004I message (TCPPORT=portnumber) when the Distributed Data Facility (DDF) is started. The -DISplay DDF command could also be used.

 

If accessing a z/OS data sharing group, the domain name should map to the DB2 group dynamic VIPA address. This address routes to the least loaded DB2 member. To access a specific member use the specific DB2 member dynamic VIPA address and turn off sysplex routing. Each member DSNL004I message displays the member specific domain name.

 

Note: A second port used for two-phase commit resynchronization operations over TCP/IP connections is assigned by the server. For example, the DB2 Universal Database for z/OS and OS/390 bootstrap dataset assigns a port number (RESPORT) to be used for resynchronization for inbound connections to DB2 Universal Database for z/OS and OS/390 only. No service name need be defined for this.

 

Database Name

 

You will need to exact name of the database to which you want to connect from your DB2 connect servers by determining the LOCATION name from the DDF.  You can display the name of the database on z/OS by running the -DIS DDF command. DSNL082I and DSNL083I contain the Location of the Db2 Subsystem.  In the example below, DSNAESYS is the database name you would use:

 

DSNL082I LOCATION           LUNAME            GENERICLU

DSNL083I DSNAESYS           USIBMWZ.DB1AAPPL  -NONE  

 

Catalog Commands

 

The Catalog commands are run on the DB2 Connect server to store the information needed by applications to connect to DB2 on z/OS.  This information is given a "database name" that is referenced by applications when they connect.  The following commands are the most basic examples.  You should review the DB2 Connect User’s Guide to determine if additional options would be useful to you such as creating an alias for the physical database name.  The following three commands are necessary to allow connections to DB2 on z/OS.  You can also use the GUI Configuration Assistant to create these entries.

 

db2 catalog tcpip node DB2NODE remote ZOSHOST server 446

 

db2 catalog dcs database DB_NAME

 

db2 catalog database DB_NAME node DB2NODE authentication server

 

 

Node Directory Parameters

 

Parameter

Example value

Comment

Node Name

DB2NODE

Any name that you choose for the NODE entry.  Typically the subsystem name or logical host name for the VIPA in data sharing environments.

Symbolic destination name (APPC node)

n/a

"blank"

Remote hostname (TCP/IP node)

ZOSHOST (or TCP/IP address)

Hostname of your LPAR or IP address of the VIPA or DNS of the VIPA for the data sharing environment.

Server (TCP/IP service name or port number)

446

Port on which DB2/z is listening (1)

Security type

Program for APPC Nodes; NONE for TCP/IP nodes

Typically not specified.(2)

Notes:

1. The default TCP/IP port number for DRDA is 446

2. Unless you know that the host or iSeries database server supports SECURITY SOCKS, do not specify SECURITY for a TCP/IP node.

 

 

DCS Directory Parameters

 

Parameter

Example

Comment

Database name

DB_NAME

Name of the database on DB2/zOS

Target database name

 

You can specify an alias for the database name if you wish that will be used by the applications instead of the real database name.  Often not specified because the real database name is desired.

Application requestor

 

 

Parameter string

 

If you are in a data sharing sysplex environment then there are parameters here that you must specify.  Those parameters are defined in Chapter 4 of the DB2 Connect User's Guide.

 

 

System Database Directory Parameters

 

Parameter

Example

Comment

Database name

DB_NAME

Name of the database on DB2/zOS.  Must be the same name specified in the DCS directory.

Database alias

 

You can specify an alias for the database name if you wish that will be used by the applications instead of the real database name.

Node name

DB2NODE

Here you must reference the name that you defined for the node in the CREATE TCPIP NODE command above.

Authentication

SERVER

A value of "SERVER" tells DB2 connect to pass the user id and password provided by the user or application to DB2 on z/OS to be authenticated there.  It is rare to use other authentication methods.

 

 

Back to db2Dean’s DB2 Connect page | Home