DB2 Version 9.7 for Linux, UNIX, and Windows
IBM data server clients and drivers overview > Installation methods for IBM data server clients > Database connections for IBM data server clients >

Client-to-server communications configuration overview

This topic provides information for choosing a suitable method for configuring client-to-server communications. This topic applies to configuring IBM® data server client and server products rather than to database connectivity drivers.

Understanding client-to-server communications: Components and scenarios

The basic components involved in client-to-server communications are described below:

There are also some additional components encountered in some environments:

The scenarios listed below illustrate examples of situations covered by client-to-server communications:

When setting up a server to work with development environments (such as IBM Data Studio), you might encounter error message SQL30081N at the initial DB2 connection. A possible root cause is that the firewall at the remote database server has prevented the connection from being established. In this case, verify the firewall is properly configured to accept connection requests from the client.

Understanding client-to-server communications: Types of connections

Generally speaking, references to setting up client-to-server communications refer to remote connections, rather than local connections.

A local connection is a connection between a database manager instance and a database managed by that instance. In other words, the CONNECT statement is issued from the database manager instance to itself. Local connections are distinctive because no communications setup is required and IPC (interprocess communications) is used.

A remote connection is one where the client issuing the CONNECT statement to a database is in a different location from the database server. Commonly, the client and server are on different machines. However, remote connections are possible within the same machine if the client and server are in different instances.

Another less common type of connection is a loopback connection. This is a type of remote connection where the connection is configured from a DB2 instance (the client) to the same DB2 instance (the server).

Comparison of methods for configuring client-to-server communications

Several methods are available for configuring client-to-server communications. Choosing a suitable method involves answering two questions. The first is Which tool will you use: Configuration Assistant or command line tools?

The second question is: What type of configuration task do you want to perform? Options are:

With answers to these questions, you can use the table below to identify the appropriate configuration method. Links to each method are provided at the end of this topic. Notes follow the table that provide more details.

Table 19. Tools and methods for configuring a client-to-server connection
Type of configuration task Configuration Assistant Command line
Configure a client by entering information manually Configure a database connection manually with the Configuration Assistant Configure client-to-server connections using the command line processor
Configure a client by searching the network for servers to connect to Configure a database connection by searching the network with the Configuration Assistant Not applicable
Use the connection settings for one client as the basis for configuring additional clients
  1. Create a client profile using the Configuration Assistant
  2. Configure database connections using a client profile with the Configuration Assistant
create and use a client profile using commands db2cfexp and db2cfimp

Note:
Profiles are used in some methods for configuring client-to-server communications. A client profile is a file that contains settings for a client. Settings can include: A server profile is similar to a client profile but contains settings for a server. Profiles can be created and used with the Configuration Assistant or by using the commands db2cfexp (configuration export), and db2cfimp (configuration import).

Note:
Configuring a database connection by searching the network with the Configuration Assistant is not a recommended method for DB2 Connect customers connecting to databases on midrange or mainframe platforms.
Supported combinations of client and server versions

This section describes which versions of a client can connect to which versions of a server. This includes support for earlier versions and support for accessing DB2 databases on midrange and mainframe servers.

Combinations of DB2® Universal Database™ (UDB) Version 8, DB2 Version 9.1, and DB2 Version 9.5 (and higher)

DB2 Universal Database (UDB) Version 8 and DB2 Version 9.1 clients can access a remote DB2 Version 9.5 server. Note the following restriction:

IBM Data Server Client, IBM Data Server Runtime Client, and IBM Data Server Driver Package Version 9.5 can access DB2 Version 9.1 and DB2 UDB Version 8 servers. However, new DB2 Version 9.5 functionality is not available.

Access to DB2 Version 9.5 (and higher) servers from DB2 UDB Version 7 clients

Access from DB2 UDB Version 7 clients is not supported.

Combinations of DB2 Version 9.5 (and higher) and DB2 products on midrange and mainframe platforms

DB2 Version 9.5 servers support access from the following clients on midrange and mainframe platforms:

IBM Data Server Client Version 9.5, IBM Data Server Runtime Client Version 9.5, and DB2 Version 9.1 clients can access DB2 Connect Version 9.5, Version 9.1, and Version 8.

Communication protocols supported

This topic identifies the supported protocols for connecting from an IBM data server client to a DB2 server. This includes:

The TCP/IP protocol is supported on all platforms on which DB2 for Linux, UNIX, and Windows is available. Both TCP/IPv4 and TCP/IPv6 are supported. IPv4 addresses have a four-part structure, for example, 9.11.22.314. IPv6 addresses have an eight-part name, where each part consists of 4 hex digits delimited by a colon. Two colons (::) represents one or more sets of zeros. For example, 2001:0db8:4545:2::09ff:fef7:62dc.

DB2 database products support the SSL protocol and accept SSL requests from applications that use the IBM Data Server Driver for JDBC and SQLJ (type 4 connectivity), IBM Data Server Driver for ODBC and CLI and IBM Data Server Driver Package. Refer to Configuring Secure Sockets Layer (SSL) support in a DB2 instance.

In addition, the Windows Named Pipes protocol is supported on Windows networks. To administer a DB2 database remotely, you must connect using TCP/IP.

Adding database connections using the Configuration Assistant
Configuring client-to-server connections using the Configuration Assistant (CA)

The Configuration Assistant is a graphical tool that can be used to configure database connections between a client and a remote DB2 database.

Important:
The Configuration Assistant has been deprecated in Version 9.7 and might be removed in a future release. For more information, see the "Control Center tools and DB2 administration server (DAS) have been deprecated" topic in the What's New in Version 9.7 book.

The Configuration Assistant is provided with the IBM Data Server Client and DB2 database products on Windows and Linux (Intel® x86 and x64 platforms).

The Configuration Assistant can configure a connection to a database only if the remote database manager is configured to accept inbound client requests. By default, the DB2 database product installation program detects and configures most protocols for inbound client connections.

You can configure a connection to a database using one of the following methods:

Configuring a database connection by searching the network using the Configuration Assistant
Use this method if you don't have any information about the database you want to connect to. This method will search your network and list all the databases available to you. A DB2 Administration Server (DAS) must be running and enabled on the servers for the discovery feature of the CA to return information about DB2 systems.
Configuring database connections using a client profile with the Configuration Assistant
Use this method if you have been given a file that contains all the necessary information to access the target database. This method can also be used to catalog and connect to multiple databases specified in the access profile file.
Configuring a database connection manually using the Configuration Assistant
Use this method if you know all the information necessary to connect to the target database. You must know:
Configuring a database connection manually using the Configuration Assistant

If you have the information for the database you want to connect to and the server upon which it resides, you can manually enter all of the configuration information. This method is analogous to entering commands using the command line processor, however, the parameters are presented graphically.

Before you configure a connection to a database manually using the Configuration Assistant (CA):

To configure a connection to a database manually using the CA:

  1. Log on to the system with a valid DB2 user ID.
  2. Start the CA. The CA can be started from the Start menu on Windows or using the db2ca command.
  3. On the CA menu bar, under Selected, choose Add Database Using Wizard.
  4. Select the Manually configure a connection to a database radio button and click Next.
  5. If you are using Lightweight Directory Access Protocol (LDAP), select the radio button that corresponds to the location where you want DB2 directories to be maintained. Click Next.
  6. Select the radio button that corresponds to the protocol that you want to use from the Protocol list. (Note: While APPC, APPN, or NetBIOS might still display as options, they are no longer supported.) If DB2 Connect is installed on your system and you select TCP/IP, you have the option to select The database physically resides on a host or OS/400 system. If you select this check box, you have the option of selecting the type of connection that you want to make to the host or OS/400® database:

    Click Next.

  7. Type the required communication protocol parameters and click Next.
  8. Type the database alias name of the remote database that you want to add in the Database name field and a local database alias name in the Database alias field. If you are adding a host or OS/400 database, type the location name for an OS/390 or z/OS database, the RDB name for an OS/400 database, or the DBNAME for a VSE or VM database in the Database name field. Optionally, you can add a comment that describes this database in the Comment.

    Click Next.

  9. If you are planning to use ODBC, register this database as an ODBC data source. Ensure that ODBC is installed before performing this operation. Click Next.
  10. In the Specify the node options window, select the operating system, and type the remote instance name for the database system you want to connect to.
  11. In the Specify the system options window, ensure that system name, host name, and operating system are correct. The information on this panel is used to configure the administration node. You can optionally enter a comment. Click Next.
  12. In the Specify the security options window, specify the security option that will be used for authentication.
  13. Click Finish. You can now use this database. Select the Exit menu action to close the CA.

Configuring a database connection by searching the network using the Configuration Assistant

You can use the Configuration Assistant (CA) to search a network for databases.

Before you configure a database connection by searching the network:

The search method feature might be unable to detect a remote system if:

The following points apply to cases where you want to explicitly configure an IPv6 address on a network that supports IPv6:

To configure a database connection by searching the network:

  1. Log on to the system with a valid DB2 user ID.
  2. Start the CA. The CA can be started from the Start menu on Windows or using the db2ca command on both Windows and UNIX systems.
  3. On the CA menu bar, under Selected, choose Add Database Using Wizard. The Add Database Wizard opens.
  4. Select the Search the network radio button and click Next.
  5. Double-click the folder beside Known Systems to list all the systems known to your client or double-click the folder beside Other Systems to list all the systems on the network. If no systems are listed, you can click Add System to specify one. After you add a system, it displays in the Known Systems list.
  6. Expand the entries for the system you are interested in until you see the database you want to add. Select the database. Click Next.
  7. Type a local database alias name in the Database alias field and optionally type a comment that describes this database in the Comment field.
  8. If you are planning to use ODBC, register this database as an ODBC data source. ODBC must be installed to perform this operation.
  9. Click Finish. You can now use the database you added. Click Close to exit the CA.
Creating a client profile using the Configuration Assistant

This task involves exporting settings from an existing client into a client profile using the Configuration Assistant (CA). This task is part of a larger task of setting up one or more clients using the settings from an existing client.

To create a client profile using the CA:

  1. Log on to the system with a valid DB2 user ID.
  2. Start the CA. The CA can be started from the Start menu on Windows or using the db2ca command.
  3. From the Configure menu, select Export Profile.
  4. Select one of the following options:
    All
    If you want to create a profile that contains all of the databases cataloged on your system, and all of the configuration information for this client. Type a name for your client profile and click Save.
    Database Connections
    If you want to create a profile that contains all of the databases cataloged on your system without any of the configuration information for this client. Type a name for your client profile and click Save.
    Customize
    If you want to select a subset of the databases that are cataloged on your system, or a subset of the configuration information for this client. In the Customize Export Profile window:
    1. Type a name for your client profile.
    2. Select the Database connections checkbox to include database connections in the client profile.
    3. From the Available database aliases box, select the databases to be exported and click > to add them to the Selected database aliases box. To add all of the available databases to the Selected database aliases box, click >>.
    4. Select the check boxes that correspond to the options that you want to set up for the target client. Database manager configuration parameters can be updated and customized for a target machine.
    5. Click Export to complete this task.
    6. Check your results displayed in the Results tab.

Once you have completed this task, you can configure other clients using the client profile you have created.

Configuring database connections using a client profile with the Configuration Assistant

This task involves configuring a client by using a client profile that you have created or obtained previously. This task is part of a larger task of setting up one or more clients using the settings from an existing client. These steps can be repeated for each client you want to configure.

  1. Log on to the system with a valid DB2 user ID.
  2. Start the CA. The CA can be started from the Start menu on Windows or using the db2ca command.
  3. From the Configure menu, select Import Profile.
  4. Select one of the following import options. You can choose to import all or a subset of the information in a client profile.
    All
    Select this option to import everything in a client profile. Open the client profile you want to import.
    Customize
    Select this option to import a subset of the client profile, such as a specific database. From the Customize Import Profile window:
    1. Select the client profile you want to import and click Load.
    2. Select the databases to be imported from the Available database aliases box and click > to add them to the Selected database aliases box. Click >> to add all of the available databases to the Selected database aliases box.
    3. Select the check boxes that correspond to the options that you want to customize.
    4. Click Import to complete this task.
    5. Check your results displayed in the Results tab.
Testing a database connection using the Configuration Assistant

After configuration, test your database connection.

To test a database connection:

  1. Start the Configuration Assistant.
  2. Highlight the database in the details view and select Test Connection from the Selected menu. The Test Connection window opens.
  3. Select one or more types of connection that you want to test (CLI is the default). You can test more than one type at the same time. Enter a valid user ID and password for the remote database and click Test Connection. If the connection is successful, a message confirming the connection appears on the Results page. If the connection test failed, you will receive a help message. To change any settings you might have incorrectly specified, select the database in the details view and select Change Database from the Selected menu item.

When setting up a server to work with development environments (such as IBM Data Studio), you might encounter error message SQL30081N at the initial DB2 connection. A possible root cause is that the firewall at the remote database server has prevented the connection from being established. In this case, verify the firewall is properly configured to accept connection requests from the client.

LDAP considerations for the Configuration Assistant

In an LDAP-enabled environment, the directory information about DB2 servers and databases is stored in the LDAP directory. When a new database is created, the database is automatically registered in the LDAP directory. During a database connection, the client accesses the LDAP directory to retrieve the required database and protocol information and uses this information to connect to the database.

However, you can still use the CA in the LDAP environment to:

Configuring client-to-server connections using the command line processor

This task describes how to configure a connection from an IBM data server client to a remote database server using the command line processor (CLP).

Before you configure a client to server connection, ensure:

Separate topics are provided to guide you through each of the following steps. Some steps have a version for each supported protocol:

  1. Identify the communication parameter values for the remote database server. Worksheets are provided:
  2. If you are using TCP/IP, you have the option to update the client's hosts file and services file with communication parameter values for the remote database server. This step does not apply to Named Pipes.
  3. Catalog the server node from the client. Instructions are provided for each communications protocol:
  4. Catalog the database that you want to connect to on the client.
  5. Test the client-to-server connection.

Named pipe connections
Named Pipes worksheet for configuring Named Pipes on the client

Use the following worksheet to help identify the required parameter values for configuring Named Pipes communications.

Table 20. Named Pipes parameter values worksheet
Parameter Description Sample Value Your Value
Computer name (computer_name)

The computer name of the server machine.

On the server machine, to locate the value for this parameter, click on Start and select Settings, Control Panel. Double-click on the Network folder and select the Identification tab. Record the computer name.

server1  

Instance name (instance_name)

The name of the instance on the server to which you are connecting.

db2  
Node name (node_name)

A local alias, or nickname, that describes the node to which you are trying to connect. You can choose any name you want; however, all node name values within your local node directory must be unique.

db2node  

Cataloging a Named Pipes node from a client using the CLP

Cataloging a Named Pipes node adds an entry to the client's node directory to describe the remote node. This entry specifies the chosen alias (node_name), the remote server's workstation name (computer_name), and the instance (instance_name) that the client will use to access the remote DB2 server.

To catalog a Named Pipes node on an IBM data server client, type the following command in the command line processor (CLP):

   db2 => catalog npipe node node_name 
   db2 => remote computer_name instance instance_name

   db2 => terminate

To catalog a remote node called db2node that is located on a server called server1 in the db2 instance, use:

   db2 => db2 catalog npipe node db2node remote server1 instance db2

   db2 => terminate
TCP/IP connections
TCP/IP worksheet for configuring a client to server connection

As you proceed through the configuration steps, use the Your Value column in the following table to record the required values.

Table 21. TCP/IP parameter values worksheet
Parameter Description Sample Value Your Value

Version of the IP protocol

Options are:

  • IPv4: addresses look like this 9.21.15.235
  • IPv6: addresses look like this: 2001:0db8:4545:2::09ff:fef7:62dc
IPv4

Host name

  • Hostname (hostname) or
  • IP address (ip_address)

To resolve the hostname of the remote system, enter the hostname command at the server.

To resolve the IP address, enter the ping hostname command.

myserver

or

9.21.15.235

or an IPv6 address

 

Service Name

  • Connection Service name (svcename) or
  • Port number/Protocol (port_number/tcp)
Values Required in the services file.

The Connection Service name is an arbitrary name that represents the connection port number (port_number) on the client.

The port number must be the same as the port number that the svcename parameter maps to in the services file on the server system. (The svcename parameter is located in the database manager configuration file on the server instance.) This value must not be in use by any other applications, and must be unique within the services file.

On Linux or UNIX platforms, this value generally must be 1024 or higher.

Contact your database administrator for the values used to configure the server.

server1

or

3700/tcp

Node name (node_name)

A local alias, or nickname, that describes the node to which you are trying to connect. You can choose any name you want; however, all node name values within your local node directory must be unique.

db2node  
Updating hosts and services files for TCP/IP connections

This task explains when and how to update the hosts file and services file on the client with communication parameter values for the remote database server. This task is optional for connections using TCP/IP and does not apply to connections using Named Pipes. This task is part of the larger task of configuring client-to-server connection using the CLP.

You need to update the hosts file if you want to establish a connection to the remote database server using its hostname and your network does not contain a DNS (domain name server) that can be used to resolve that hostname to an IP address. This step is not required if you want to refer to the remote database server using its IP address.

You need to update the services file if you want to specify a connection service name when establishing a connection to the remote database server. A connection service is an arbitrary name that represents the connection port number. This step is not required if you want to refer to the remote database server's port number.

Procedure

The following table lists the location of the hosts file and services file referred to in the preceding procedures.

Table 22. Location of the hosts file and services file
Operating System Directory
Windows 2000 XP/Windows Server 2003 %SystemRoot%\system32\drivers\etc where %SystemRoot% is a system defined environment variable
Linux or UNIX /etc
Cataloging a TCP/IP node from a client using the CLP

Cataloging a TCP/IP node adds an entry to the Data Server Client node directory that describes the remote node. This entry specifies the chosen alias (node_name), the hostname (or ip_address), and the svcename (or port_number) that the client uses to access the remote host.

You must have System Administrative (SYSADM) or System Controller (SYSCTRL) authority, or have the catalog_noauth option set to ON. You cannot catalog a node using root authority.

To catalog a TCP/IP node:

  1. Log on to the system as a user with System Administrative (SYSADM) or System Controller (SYSCTRL) authority.
  2. If you are using a Linux or UNIX client, set up the instance environment. Run the start-up script:
    For bash, Bourne or Korn shell
       . INSTHOME/sqllib/db2profile
    For C shell
       source INSTHOME/sqllib/db2cshrc
    where INSTHOME represents the home directory of the instance.
  3. Start the DB2 command line processor. On Windows, issue the db2cmd command from a command prompt. On Linux or UNIX, issue the db2 command from a command prompt.
  4. Catalog the node by entering the following commands in the command line processor:
    db2 => catalog tcpip node node_name remote hostname|ip_address
      server service_name|port_number [remote_instance instance_name]
      [system system_name] [ostype  os_type]
    
    db2 => terminate
    where:
    Note:
    1. The terminate command is needed to refresh the directory cache.
    2. Although remote_instance, system, and ostype are optional, they are required for users who want to use the DB2 tools.
    3. The service_name used on the client does not have to be the same as the one on the server. However, the port numbers that they map to must match
    4. While not shown here, the catalog tcpip node command provides the option to explicitly specify the version of IP, namely IPv4 or IPv6.

To catalog a node that you want to call db2node on a remote server myserver.ibm.com that is using port number 50000, you would enter the following from a db2 prompt:

db2 => catalog tcpip node db2node remote myserver server 50000
DB20000I  The CATALOG TCPIP NODE command completed successfully.
DB21056W  Directory changes may not be effective until the directory cache is
refreshed.

db2 => terminate
DB20000I  The TERMINATE command completed successfully.

Cataloging a database from a client using the CLP

This task describes how to catalog a database from a client using the command line processor (CLP).

Before a client application can access a remote database, the database must be cataloged on the client. When you create a database, the database is automatically cataloged on the server with a database alias that is the same as the database name, unless a different database alias was specified.

The information in the database directory, along with the information in the node directory (unless you are cataloging a local database where a node is not needed), is used on the IBM data server client to establish a connection to the remote database.

To catalog a database on the client:

  1. Log on to the system with a valid DB2 user ID.
  2. Optional. Update the Your Value column in the Parameter values worksheet for cataloging a database.
  3. If you are using the DB2 database on a Linux or UNIX platform, set up the instance environment. Run the start-up script:
    For bash, Bourne or Korn shell
       . INSTHOME/sqllib/db2profile
    For C shell
       source INSTHOME/sqllib/db2cshrc
    where: INSTHOME represents the home directory of the instance.
  4. Start the DB2 command line processor. On Windows, issue the db2cmd command from a command prompt. On Linux or UNIX, issue the db2 command from a command prompt.
  5. Catalog the database by entering the following commands in the command line processor:
    db2 => catalog database database_name as database_alias at
       node node_name [ authentication auth_value ]
    where:

To catalog a remote database called sample so that it has the local database alias mysample, on the node db2node using authentication server, enter the following commands:

db2 => catalog database sample as mysample at node db2node
       authentication server

db2 => terminate

Parameter values worksheet for cataloging a database

Use the following worksheet to record the parameter values required to catalog a database.

Table 23. Catalog database parameter values worksheet
Parameter Description Sample Value Your Value
Database name (database_name) When a database is created, the database alias is set to the database name unless otherwise specified. For example, when the sample database is created on the server, a database alias of sample is also created. The database name represents the remote database alias (on the server). sample  
Database alias (database_alias) An arbitrary local nickname that represents the remote database. If you do not provide one, the default is the same as the database name (database_name). Use this name when you connect to the database from a client. mysample  
Authentication (auth_value) The type of authentication required in your environment. Server  
Node name (node_name) The name of the node directory entry that describes where the database resides. Use the same value for node name (node_name) that you used to catalog the node. db2node  
Testing the client-to-server connection using the CLP

After cataloging the node and the database, connect to the database to test the connection. Before testing the connection:

To test the client to server connection:

  1. If you are using a Linux or UNIX platform, set up the instance environment. Run the start-up script:
    For bash, Bourne or Korn shell
       . INSTHOME/sqllib/db2profile
    For C shell
       source INSTHOME/sqllib/db2cshrc
    where: INSTHOME represents the home directory of the instance.
  2. Start the DB2 command line processor. On Windows, issue the db2cmd command from a command prompt. On Linux or UNIX, issue the db2 command from a command prompt.
  3. Type the following command on the client to connect to the remote database:
       db2 => connect to database_alias user userid 
    For example, enter the following command:
       connect to mysample user jtris  
    You will be prompted to enter your password.

If the connection is successful, you receive a message showing the name of the database to which you have connected. A message similar to the following is given:

Database Connection Information     
Database server = DB2 9.1.0     
SQL authorization ID = JTRIS     
Local database alias = mysample

You can now work with the database. For example, to retrieve a list of all the table names listed in the system catalog table, enter the following SQL statement:

select tabname from syscat.tables

When you are finished using the database connection, enter the connect reset command to end the database connection.

[ Top of Page | Previous Page | Next Page | Contents ]