Troubleshooting
Problem
Execution of
db2 connect to sample user
Symptom
SQL30061N The database alias or database name "sample" was not found at
the remote node.
Cause
The port number used by the DB2 Listener for the instance was being used by another application.
Environment
ALL
Diagnosing The Problem
netstat -an | grep <port svcename using>
Result:
TCP [::]:50001 [::]:0 LISTENING
TCP [::]:50001 [::]:0 LISTENING
If DB2 instance is stopped, netstat -an shows:
TCP [::]:50001 [::]:0 LISTENING
This indicates that another application is still using the port.
Resolving The Problem
Find a port that is not being used by another application, DB2 or otherwise.
To find the entry currently being used for the instance run:
db2 get dbm cfg | grep SVCENAME
If points to port number then run:
db2 update dbm cfg using SVCENAME <new port number>
If points to a string value the entry is found in /etc/services
Simply update the value in /etc/services to point to the new port number.
ie
db2c_db2inst1 50050/tcp
DB2 must be restarted after the port number is changed in order to start the DB2 Listener on the new port.
db2stop
db2start
Please note that all clients will need to recatalog the NODE used for the database to point to the new port number.
ie db2 uncatalog node TLBA12E
db2 catalog tcpip node TLBA12E remote <server name> server <new port# ie 50050 in this example>
Also check JDBC application connection strings, db2cli.ini and db2dsdriver.cfg configuration files.
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21697748