Configuring client-to-server communications for the IBM® data server client and
DB2 database server products requires and understanding of the components
and type of connections.
Components and scenarios
The basic components
involved in client-to-server communications are described in the following
section:
- Client. This refers to the initiator of the communications.
This role can be filled by any of the following DB2® products or components:
- IBM Data
Server Driver Package
- IBM Data
Server Client or IBM Data Server Runtime Client.
- DB2 Connect™: This product is a superset of the IBM Data
Server Client.
- a DB2 server product: A DB2 server is a superset of the Data Server
Client.
- Server. This refers to the receiver of the communications
request from the client. This role is normally filled by a DB2 for Linux, UNIX,
and Windows server product.
When DB2 Connect products
are present, the term server can also mean a DB2 server on a midrange or mainframe platform.
- Communications protocol. This refers to the protocol used
to send data between the client and server. The DB2 product supports several protocols:
- TCP/IP. A further distinction can be made between the version:
TCP/IPv4 or TCP/IPv6.
- Named Pipes. This option is available on Windows only.
- IPC (interprocess communications). This protocol is used for local
connections.
There are also some additional components encountered in some
environments:
- DB2 Connect gateway. This
refers to a DB2 Connect server
product that provides a gateway by which IBM data server client can
connect to DB2 servers on midrange
and mainframe products.
- LDAP (Lightweight Directory Access Protocol). In an LDAP-enabled
environment, it is not necessary to configure client-to-server communications.
When a client attempts to connect to a database, if the database does
not exist in the database directory on the local machine then the
LDAP directory is searched for information required to connect to
the database.
The following scenarios illustrate examples of situations
covered by client-to-server communications:
- Data Server
Client establishes
communications with a DB2 server
using TCP/IP.
- Data Server Runtime Client establishes
communications with a DB2 server
using Named Pipes on a Windows network.
- DB2 server establishes communications
with another DB2 server via
some communications protocol.
- Data Server
Client establishes
communications with a mainframe DB2 server
via a DB2 Connect server
using TCP/IP.
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.
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).
Configuration of client-to-server communications
You
can configure client-to-server communications by using the command
line tools which consist of the Command Line Processor (CLP), the db2cfexp (configuration
export) command, and the db2cfimp (configuration
import) command.
Use the following table to identify the appropriate
configuration method.
Table 1. Tools and methods for configuring
a client-to-server connectionType of configuration task |
CLP |
Configure a client by entering information manually |
Configure client-to-server connections by using
the CATALOG TCPIP/TCPIP4/TCPIP6 NODE command and
the CATALOG DATABASE command. |
Use the connection settings for one client as
the basis for configuring additional clients |
- Create a client profile by issuing the db2cfexp command.
- Configure database connections using a client profile by issuing
the db2cfimp command.
|
Note: Use
Profiles to configure client-to-server communications.
The types of profiles are:
- A client profile is a file that contains settings
for a client. Settings can include:
- Database connection information (including CLI or ODBC settings).
- Client settings (including database manager configuration parameters
and DB2 registry variables).
- CLI or ODBC common parameters.
- A server profile is similar to a client profile but
contains settings for a server.
In IBM Data Studio Version
3.1 or later, you can use the task assistant for configuring
automatic maintenance. Task assistants can guide you through the
process of setting options, reviewing the automatically generated
commands to perform the task, and running these commands. For more
details, see Administering databases with task assistants.