DB2 – How to Add a Catalog to a New Remote Server

db2

I'm trying to add a new database catalog to my client environment in a windows server machine.

So I've run the db2cmd tool and then the db2 tool on a windows command console once there I executed the command:

db2 => list db directory

 System Database Directory

 Number of entries in the directory = 2

Database 1 entry:

 Database alias                       = DB01
 Database name                        = DB01
 Node name                            = DB01
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Remote
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =

Database 2 entry:

 Database alias                       = DB02
 Database name                        = DB02
 Node name                            = DB02
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Remote
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =

Then I add a new catalog following the docs:

db2 => catalog tcpip node DB03 remote ***.***.***.*** server *****
DB20000I The CATALOG TCPIP NODE command completed successfully.
DB21056W The directory changes may not take effect until the directory cache is
updated.

After that I run list db directory again and the result was the same as previous one. I then, run the command:

 db2 => list node directory

  Node Directory
  Number of entries in the directory = 3

 Node 1 entry:
  Node name                      = DB01
  Comment                        =
  Directory entry type           = LOCAL
  Protocol                       = TCPIP
  Hostname                       = ***.***.***.***
  Service name                   = *****

 Node 2 entry:
  Node name                      = DB02
  Comment                        =
  Directory entry type           = LOCAL
  Protocol                       = TCPIP
  Hostname                       = ***.***.***.***
  Service name                   = *****

 Node 3 entry:
  Node name                      = DB03
  Comment                        =
  Directory entry type           = LOCAL
  Protocol                       = TCPIP
  Hostname                       = ***.***.***.***
  Service name                   = *****

So the node was created but it didn't show on the directory list, looking through the docs it says that I should run the terminate command

Notice:
The command terminate is needed to refresh the directory cache.

Then it leave the db2 terminal and then I entered it again run the list db directory and again nothing changed.

So, my question is: How do I refresh the database directory??

I'm new to DB2. I have a lot experience with Oracle and what I could understand that this configuration is like adding a new entrance on the the tnsnames.ora file

Best Answer

Node directory and database directory are different things. The node directory lists DB2 instances. The database directory lists databases in those instances.

Once you have added a node to the node directory, you will need to catalog a database on that node:

catalog db yourdb at node db03