When you create a new database, it is automatically cataloged in the system database directory file. You might also use the CATALOG DATABASE command to explicitly catalog a database in the system database directory file.
The CATALOG DATABASE command allows you to catalog a database with a different alias name, or to catalog a database entry that was previously deleted using the UNCATALOG DATABASE command.
Although databases are cataloged automatically when a database is created, you still might have a need to catalog the database. When you do so, the database must exist.
By default directory files, including the database directory, are cached in memory using the Directory Cache Support (dir_cache) configuration parameter. When directory caching is enabled, a change made to a directory (for example, using a CATALOG DATABASE or UNCATALOG DATABASE command) by another application might not become effective until your application is restarted. To refresh the directory cache used by a command line processor session, issue the TERMINATE command.
In a partitioned database, a cache for directory files is created on each database partition.
In addition to the application level cache, a database manager level cache is also used for internal, database manager look-up. To refresh this "shared" cache, issue the db2stop and db2start commands.
CATALOG DATABASE personl AS humanres
WITH "Human Resources Database"
Here, the system database directory entry will have HUMANRES as the database alias, which is different from the database name (PERSON1).
To catalog a database in the system database directory from a client application, call the sqlecadb API.
CATALOG DATABASE b as b_on_ic AT NODE instnc_c