DB2 CATALOG database command
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
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
- db2 catalog tcpip node XYZ remote somehost.your.dom server NNNNNN
- db2 catalog database remote_db as remote_db at node XYZ
db2 connect to remote_db user dbuser using dbpassword