Cataloging a Database in an IBM DB2 Universal Database Client

Catalog a database in an IBM DB2 Universal Database.

  1. Determine if the database has already been cataloged. At the CLP command prompt, execute:
    list database directory
    Depending on whether the database is local (first entry below) or remote (second entry below), you see results similar to this:
    Database 1 entry:
    Database alias                       = GRP_DB
    Database name                        = GRP_DB
    Local database directory             = /db2home/db2inst1
    Database release level               = b.00
    Comment                              = UTF-8(Unicode DB)
    Directory entry type                 = Indirect
    Catalog database partition number    = 0
    Alternate server hostname            =
    Alternate server port number         =
    Database 2 entry:
    Database alias                       = DB1V9_DS
    Database name                        = DB1_V9
    Node name                            = DB2NODE2
    Database release level               = b.00
    Comment                              = 
    Directory entry type                 = Remote
    Catalog database partition number    = -1
    Alternate server hostname            =
    Alternate server port number         =
  2. If your desired database is not listed or does not have a database alias, catalog it at the CLP prompt.
    • To catalog a database using the default alias, which is the same as the database name:

      CATALOG DATABASE database_name AT NODE node_name
      where:
      • database_name is the name of either the primary or replicate database.

      • node_name is the name of the node that contains the database.

    • To catalog a database with a specific alias:

      CATALOG DATABASE database_name AS my_alias AT NODE node_name

      where:

      • database_name is the name of either the primary or the replicate database.

      • my_alias is your desired alias.

      • node_name is the name of the node that contains the database.

  3. Verify that the database has been cataloged by issuing the list database directory command again.
  4. To exit the DB2 CLP, enter the quit command.