The following must be done to allow the application server to use TCP/IP.
TCP/IP support is invoked at system initialization time. If TCP/IP for VM is available, the server will make use of it. The application server must be able to determine what port number to listen on for connections. This can be accomplished in a number of ways.
Each method has advantages and disadvantages.
The first method of using the ETC SERVICES file is the preferred method. This file is maintained by the TCP/IP administrator and resides on the TCP/IP client data disk. Since many application servers can run on the same VM system, it must be ensured that they do not use the same TCP/IP port since only one server can use a port. Identifying the port numbers in this file makes it easier to ensure that different servers are using different ports. The name used must be the application server's RESID. This can be determined by issuing the SHOW INITPARM command on the application server.
The entry in the ETC SERVICES file consists of a service name, port number, protocol and an optional comment. Valid protocols in the ETC SERVICES. file are tcp and udp. The only protocol DB2 Server for VM will recognize is tcp. It cannot understand udp. It must be noted that the searches done on the ETC SERVICES file are case sensitive. When the RESID is used as the search criteria it will be entirely in upper case and must be defined entirely in upper case. Similarly, the protocol is also part of the search criteria and is specified entirely in lower case and must be defined in lower case for the search to be successful.
The following is an example of entries for 2 DB2 Server for VM application servers.
SQLPROD 6100/tcp # Production database machine SQLTEST 6200/tcp # Test database machine
The second method of port identification is the new initialization parameter, TCPPORT. The advantage of this is that the ETC SERVICES file does not need to be updated. This is helpful when initially testing TCP/IP support or when TCP/IP support needs to be enabled, but the ETC SERVICES file cannot be updated. The disadvantage is that it is possible that another application may be using the same port.
The third method is the least desirable. If there is no entry for the RESID in the ETC SERVICES file or TCPPORT was not specified, there is a well known port assignment for relational databases. It is called ddm-rdb and the port number is 446. This name must be defined in the ETC SERVICES file. The file that is shipped with TCP/IP for VM has this definition. This has the advantage of doing no extra configuration to TCP/IP for VM and to the application server. The disadvantage is that only one application server on that VM system can use that definition.
We will take advantage of all three of the methods. The actions can be broken down into three scenarios.