Diagnosing Client-Server TCP/IP Connection Problems
SQL30081N Communication error and SQL1013N Database not found are the most common connection errors. If either of these errors occurs, you need to verify the server and client configurations.
- On the server, verify that the DB2 instance is properly set up to accept client connections.
- On the client, verify that the node directory, database directory, and in the case of a host connection, the DCS directory, are set up correctly.
F.0.1. Verifying the Server Configuration
At the database server, follow this procedure to verify its configuration.
1. | Verify that the database exists by issuing one of the following commands at the server:or Figure F.2 shows the output for the list db directory command. Figure F.2. Verifying that a database exists on the server![]() |
2. | Check the DB2COMM registry variable to verify that the correct communication protocol is specified by using the db2set all command (see Figure F.3).Figure F.3. Checking the DB2COMM registry variable on the server![]() |
3. | Verify that the appropriate configuration parameters are set in the Database Manager Configuration file. Issue the get dbm cfg command and examine the following.
In Figure F.4, you can see that the SVCENAME is set to a service name, db2c_DB2. Figure F.4. Verifying that SVCENAME or NNAME is correctly set on the server[View full size image] ![]() |
If SVCENAME is set to a service name instead of a port number, confirm that the value listed there is mapped to a unique port number in the operating system's services file. For example:
If this line is not already in the services file, use a text editor to add it.After you have made sure that you can connect locally on the server and that the server is set up correctly to accept client connections, verify the client configuration.
db2c_DB2 50000/tcp # Connection port for DB2 instance db2inst1
F.0.2. Verifying the Client Configuration
At the client, follow these steps to verify its configuration.
1. | Verify that the server connectivity information has been correctly entered in the node directory by using the list node directory command.The service name in the client's node directory is a port number that matches the port number referenced by the SVCENAME on the server. For example, the SVCENAME on the server is set to db2c_DB2 , as shown in Figure F.4, and as we saw, this mapped to port 50000 in the server's services file. Therefore, the client needs to specify port 50000 in the node directory, as shown in Figure F.5.Figure F.5. Checking the node directory on a client[View full size image] ![]()
|
2. | Verify that you can ping the host name exactly as it appears in the node directory. If you cannot, that means there is problem connecting to the server. Try to ping the IP address of the server. If that works, then recatalog the node using the IP address instead of the host name and try again.To recatalog the node directory, you need to first uncatalog the existing node:
|
3. | Even if the client can reach the server, it does not necessarily mean that the client can access the port to connect to databases on the server. Sometimes, for security reasons, the server port is not open to client connections, or the port is not enabled at all. To test if a port is accessible, you can telnet to the port as follows:alias in the server's database directory (see Figure F.6). Figure F.6. Verifying that the database name in the client database directory matches the database alias on the server![]() Figure F.7. Verifying that the database name in the database directory matches the database name in the DCS directory[View full size image] ![]() |
Figure F.8 displays a flowchart for diagnosing client-server connectivity problems. It summarizes what we have discussed so far. The client is a DB2 client; the server can be either a DB2 UDB server or a DB2 Connect gateway.
Figure F.8. Diagnostic flowchart for client-server connectivity problems
[View full size image]

Figure F.9. Diagnostic path for client-host connection problems
Chapter 6).