IBM Books

Quick Beginnings for DB2 Connect


Step 5. Catalog the Database

Before a client application can access a remote database, the database must be cataloged on the host system node and on any DB2 Connect workstation nodes that will connect to it. When you create a database, it is automatically cataloged on the host with the database alias (database_alias) the same as the database name (database_name). The information in the database directory, along with the information in the node directory, is used on the DB2 Connect workstation to establish a connection to the remote database.

To catalog a database on the DB2 Connect Workstation, perform the following steps.

Step  1.

Log on to the system as a user with System Administrative (SYSADM) or System Controller (SYSCTRL) authority.

Step  2.

Fill in the Your Value column in the following worksheet.

Table 7. Worksheet: Parameter Values for Cataloging Databases
Parameter Description Sample Value Your Value
Database name (database_name) The local DCS database name (local_dcsname) of the remote database. You specified this when you catalogued the DCS database directory. For example, ny. ny  
Database alias (database_alias) An arbitrary local nickname for the remote database. If you do not provide one, the default is the same as the database name (database_name). This is the name that you use when connecting to the database from a client. localny  
Node name (node_name) The name of the node directory entry that describes where the database resides. Use the same value for node name (node_name) that you used to catalog the node in the previous step. db2node  

Step  3.

Set up the instance environment and invoke the DB2 command line processor. Run the start-up script as follows:

   . INSTHOME/sqllib/db2profile    (for Bourne or Korn shell)
   source INSTHOME/sqllib/db2cshrc (for C shell)

where INSTHOME is the home directory of the instance.

Step  4.

Catalog the database by entering the following commands in the command line processor:

   db2 catalog database database_name as database_alias at node node_name
   db2 terminate

For example, to catalog the DCS known database ny so that it has the local database alias localny, on the node db2node, enter the following commands:

   db2 catalog database ny as localny at node db2node
   db2 terminate


Figure hint not displayed.

If you need to change values that were set with the catalog database command, perform the following steps:

Step  a.

Run the uncatalog database command in the command line processor as follows:

   db2 uncatalog database database_alias

Step  b.

Recatalog the database with the value that you want to use.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]