We have „almost“ fresh DB2 install in our Debian environment, running in VirtualBox. Well, now we want to have this db2 instance as server and client (host) would be connecting into server from some GUI. Few steps are necessary.
1) Server side
Setting communication protocol is mandatory. This activity is done in very old special environment = registry. Don‘ t shout and panic, DB2 registry are not so beloved Windows registry 😉
db2inst1@debian:~$ db2set DB2COMM=TCPIP
And of course we can check all values in registry:
db2inst1@debian:~$ db2set -all
[i] DB2COMM=TCPIP
[i] DB2AUTOSTART=YES
[g] DB2SYSTEM=debian
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=dasusr1
Next we need to locate port number for service dedicated to db2 instance. Default values for me:
db2inst1@debian:~$ cat /etc/services | grep db2
DB2_db2inst1 60006/tcp
DB2_db2inst1_1 60007/tcp
DB2_db2inst1_2 60008/tcp
DB2_db2inst1_3 60009/tcp
DB2_db2inst1_4 60010/tcp
DB2_db2inst1_END 60011/tcp
Ok, we can remember first line = 60006.
Now database manager must know number to bind db2 service.
db2inst1@debian:~$ db2 get dbm cfg | grep TCP/IP
TCP/IP Service name (SVCENAME) =
db2inst1@debian:~$ db2 update dbm cfg using SVCENAME 60006
Ok, time for restarting server and double check value 🙂
db2inst1@debian:~$ db2stop
02/03/2014 21:25:04 0 0 SQL1025N The database manager was not stopped because databases are still active.
SQL1025N The database manager was not stopped because databases are still active.
db2inst1@debian:~$ db2stop force
02/03/2014 21:25:11 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
db2inst1@debian:~$ db2start
SQL8007W There are „83“ day(s) left in the evaluation period for the product
„DB2 Advanced Enterprise Server Edition“. For evaluation license terms and
conditions, refer to the License Agreement document located in the license
directory in the installation path of this product. If you have licensed this
product, ensure the license key is properly registered. You can register the
license by using the db2licm command line utility. The license key can be
obtained from your licensed product CD.
02/03/2014 21:26:08 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
db2inst1@debian:~$
db2inst1@debian:~$ db2 get dbm cfg | grep TCP/IP
TCP/IP Service name (SVCENAME) = 60006
The only needed thing is to know ip address:
root@debian:~# ifconfig | grep Bcast
inet addr:192.168.56.102 Bcast:192.168.56.255 Mask:255.255.255.0
Server side part is completed now.
2) Client side
Let´s try to connect with DBeaver:
Done.
-a-