Find out DB2 instance running port number (UNIX/Linux)

(Question): How to find out port number of my DB2 instance?

Answer: Port number is defined at instance level through SVCENAME configuration variable.

/mnt/db2home:> db2 get instance

The current database manager instance is:  db2inst1

/mnt/db2home:> db2 get dbm cfg | grep SVCENAME

TCP/IP Service name                          (SVCENAME) = db2c_db2inst1

/mnt/db2home:> grep db2c_db2inst1 /etc/services

db2c_db2inst1        50000/tcp

 

From above, 50000 is the port number. Sometimes you directly find port number given to SVCENAME as below:

/mnt/db2home:> db2 get dbm cfg | grep SVCENAME

TCP/IP Service name                          (SVCENAME) = 50000

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: