coanor
coanor

Reputation: 3944

How to connect to a Windows DB2 server from Ubuntu client?

I want to debug the TCP/IP protocol of DB2 for some reason, and I have installed a DB2 server on Windows, but while connect from Windows local machine, there was no TCP/IP data transferred (via Wireshark,set tcp.port==50000 && drda as the filter), so I installed a Ubuntu DB2 and just using its db2 command to connect the Windows DB2 server. I find the configuration docs from IBM too complicated, and here list a solution, but the info seems too old(reference links removed).

Here is the basic info from my Windows DB2 server(192.168.37.103) after the SAMPLE database created:

> db2 connect to SAMPLE
  database connection info

 database server         = DB2/NT64 10.5.2
 SQL auth                = TANB
 local database alias    = SAMPLE

Then I want to connect to the Windows DB2 server from a Ubuntu client (192.168.37.110) via db2 connect ..., how should I configure both the server and the client?

Upvotes: 0

Views: 1100

Answers (1)

AngocA
AngocA

Reputation: 7693

The link you provided explain how an IBM Data Server Client (db2 client) should be configured.

In your database server you have:

  • One or multiple DB2 instances. For example db2adm or db2inst1.
  • One or multiple databases per instance.

In your client, you have to map that configuration.

  • The server, that could be your local machine, or one or multiple remote servers.
  • For a given server, you can have one or multiple instances, and they are called nodes.
  • For a given instance (node) you could have multiple databases.

So, you have to catalog a node that point to an instance in the Windows server. Once you have do that, you catalog databases in that node that correspond to remote database.

 db2 catalog tcpip node WinSerIn remote WinSer server 50000
 db2 catalog database Sample at node WinSerIn

And then, you just have to connect

 db2 connect to Sample

Make sure you have the ports opened. For example, you can test if Ubuntu can reach the Windows port by doing

 telnet WinSer 50000

Where WinSer is the name of the Windows server name or IP address (192.168.37.103).

Upvotes: 1

Related Questions