When using a DB2 client to connect to the DB2 server, you must know which port the DB2 server is on, but in many cases the customer does not know the port because DB2 is installed by an IBM or agent.
DB2 's listening port is the same as Oracle, and it is an instance-level port listener, and an instance requires a port for listening. Under the Linux operating system, the default instance name is Db2inst1. The listening port exists as an instance of the DB2 database, which is:
SVCENAME, use the DB2 get dbm CFG command to view the value of this parameter as:
[Db2inst1@testserver ~]$ DB2 get dbm Cfg|grep SVC
TCP/IP Service name (SVCENAME) = Db2_db2inst1
You can always view the port number corresponding to the Db2_db2inst1 service from the/etc/serivces file:
[Db2inst1@testserver ~]$ Tail-10/etc/services|grep Db2_db2inst1
Db2_db2inst1 60000/tcp
It should be seen from the above results that the DB2 Db2_db2inst1 instance listens for 60000 ports.
The operating system command is the DB2 process that listens on TCP ports of 60000.
[Db2inst1@testserver ~]$ Netstat-lnp|grep 60000 (not all processes could is identified, non-owned process info
Won't is shown, you would have to is root to the it all.)
TCP 0 0 0.0.0.0:60000 0.0.0.0:* LISTEN 14142/DB2SYSC 0
The DB2SYSC process with the DB2 process number 14142 is monitoring the 60000 process. You can connect to the DB2_DB2INST1 process by using the client connection port 60000.