DB2 10.5 for Linux, UNIX, and Windows

CATALOG DCS DATABASE command

Stores information about remote host or System i® databases in the Database Connection Services (DCS) directory.

These databases are accessed through an Application Requester (AR), such as DB2 Connect™. Having a DCS directory entry with a database name matching a database name in the system database directory invokes the specified AR to forward SQL requests to the remote server where the database resides.

Authorization

one of the following authorities:
  • SYSADM
  • SYSCTRL

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-CATALOG DCS--+-DATABASE-+--database-name--------------------->
                '-DB-------'                  

>--+--------------------------+--+------------------+----------->
   '-AS--target-database-name-'  '-AR--library-name-'   

>--+---------------------------+--+------------------------+---><
   '-PARMS--"parameter-string"-'  '-WITH--"comment-string"-'   

Command parameters

DATABASE database-name
Specifies the alias of the target database to catalog. This name should match the name of an entry in the database directory that is associated with the remote database partition server.
AS target-database-name
Specifies the name of the target host or System i database to catalog.
AR library-name
Specifies the name of the Application Requester library that is loaded and used to access a remote database listed in the DCS directory.

If using the DB2 Connect AR, do not specify a library name. The default value will cause DB2 Connect to be invoked.

If not using DB2 Connect, specify the library name of the AR, and place that library on the same path as the database manager libraries. On Windows operating systems, the path is drive:\sqllib\bin. On Linux and UNIX operating systems, the path is $HOME/sqllib/lib of the instance owner.

PARMS "parameter-string"
Specifies a parameter string that is to be passed to the AR when it is invoked. The parameter string must be enclosed by double quotation marks. For more information aboutthe parameter string, refer to the "DCS directory values" topic through the Related concepts section.
WITH "comment-string"
Describes the DCS directory entry. Any comment that helps to describe the database cataloged in this directory can be entered. Maximum length is 30 characters. A carriage return or a line feed character is not permitted. The comment text must be enclosed by double quotation marks.

Examples

The following example catalogs information about the DB1 database, which is a DB2® for z/OS® database, into the DCS directory:
   db2 catalog dcs database db1 as dsn_db_1
      with "DB2/z/OS location name DSN_DB_1"

Usage notes

The DB2 Connect program provides connections to DRDA® Application Servers such as:
  • DB2 for OS/390® or z/OS databases on System/370 and System/390® architecture host computers.
  • DB2 for VM and VSE databases on System/370 and System/390 architecture host computers.
  • System i databases on Application System/400 (System i) and System i computers.

The database manager creates a Database Connection Services directory if one does not exist. This directory is stored on the path that contains the database manager instance that is being used. The DCS directory is maintained outside of the database.

The database must also be cataloged as a remote database in thesystem database directory .

List the contents of the DCS directory using the LIST DCS DIRECTORY command.

If directory caching is enabled, database, node, and DCS directory files are cached in memory. An application's directory cache is created during its first directory lookup. Since the cache is only refreshed when the application modifies any of the directory files, directory changes made by other applications might not be effective until the application has restarted.

To refresh the CLP's directory cache, use the TERMINATE command. To refresh the shared cache in DB2, stop (db2stop) and then restart (db2start) the database manager. To refresh the directory cache for another application, stop and then restart that application.