It's all about the answers!

Ask a question

DB2 CATALOG database command


Kevin Scott (1112) | asked Aug 20 '18, 10:42 a.m.
edited Aug 21 '18, 9:57 a.m. by Rosa Naranjo (2.9k11723)

Why should anyone catalog a Db2 database when it automatically catalogs databases when they are created?

It catalogs an entry for the database in the local database directory and another entry in the system database directory. If the database is created from a remote client (or a client which is executing from a different instance on the same machine), an entry is also made in the system database directory at the client instance.

One answer



permanent link
Kevin Ramer (4.5k9186201) | answered Aug 20 '18, 4:03 p.m.

The most likely reason would be to enable a connection to a remote database within your 'local' instance   One example in RTC + Cognos would be where one catalogs the jazz warehouse db "adjacent" to the databases used by cognos as cognos seemingly cannot use jdbc to connect.

Another is to enable db2 cli access to a 'remote' database.  The mechanism is the same for each.

example.   somehost.your.dom contains a db2 database instance and you'd like to execute db2 queries using db2.  In your 'local' instance run these

  1. db2 catalog tcpip node XYZ remote somehost.your.dom server NNNNNN
  2. db2 catalog database remote_db as remote_db at node XYZ
NNNNNN is some port# or symbol in /etc/services.  Now one can connect on that instance to the datbase 'remote_db' with credentials and run db2 interactively ( as far as your authorization will permit )  e.g.
db2 connect to remote_db user dbuser using dbpassword

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.