Db2 – Specifying the node to connect in db2

db2

I have 2 nodes in my db2 catalog. How would I include the node on which I want to connect inside the db2 connect paramters?

 Node 1 entry:

 Node name                      = DB2HOST1
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = host1.sample.com
 Service name                   = 60000

 Node 2 entry:

 Node name                      = DB2HOST2
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = host2.sample.com
 Service name                   = 60000

This is my query:

    db2 connect to DBASE user user1 using password1 <-- works
    db2 connect to DBASE user user1 using password1 node db2host1 <-- doesn't work

Best Answer

Possibly, you could catalog the databases under a unique alias for each node:

db2 catalog db DBASE as DBASE1 at node DB2HOST1
db2 catalog db DBASE as DBASE2 at node DB2HOST2