You are connected with a terminal session to your database server and just executing the good known
In the next step you want to execute
db2 connect to blabla, but you get an error message, database is unknown – but you know, the database exists on that server… but not in that instance. You are connected to the wrong instance, because your DB server has more than one instance on it (lets call them
You can see the error, what’s next?
Ok, lets change the value set via
db2profile (or shell config), lets „overwrite“ that. For that we use the environment variable
db2 connect to blabla again, same result as before. The reason for that is, DB2 is creating a background process, which remembers the instance.
ps -ef | grep db2bp
This statement should deliver in minimum on process as result. So, how can we get to the other instance? You need to kill this process in a clean way. There is a DB2 statement for that:
If this was executed, the process
db2bp is gone and you can connect to the database, on the correct instance.
Some more information for
db2 terminate on DB2 9.7 you can find here.