CL Command Reference - ADDRDBDIRE

CL Command List > ADDRDBDIRE Reference

Description:

The Add Relational Database Directory Entry (ADDRDBDIRE) command allows you to add an entry to the relational database directory. Relational database (RDB) entries can represent local databases or remote databases. The RDB associated with an entry can also be classified as a system database or a user database.

There is only one system database per system. It is defined as the system auxiliary storage pool (ASP number 1) and configured basic user ASPs (ASP numbers 2-32). A system can be configured to have one or more user databases. A user database is defined to be an ASP group that is configured and available. Such a database is joined to the system database in such a way that all of the objects on the system database are also accessible through it.

Note: As used in this context, ¡¯system¡¯ can refer a locical partition of an iSeries machine configured with multiple partitions.

Local databases include the system database and any available user databases on this system. Remote databases normally reside on another system, but an unavailable ASP group configured on this system is also considered to be temporarily remote, because it might have been switched to another node within a cluster of systems.

Restriction: You must have execute authority to the application requester driver program to specify the program on this command.


Examples:

Example 1: Adding an Entry

ADDRDBDIRE RDB(MYRDB) RMTLOCNAME(*LOCAL)

This command adds an entry to the relational database directory. The entry identifies the local relational database. In an SQL program, this relational database name is used when referring to the local relational database.


Example 2: Adding an Entry

ADDRDBDIRE RDB(YOURRDB) RMTLOCNAME(NEWYORK)

This command adds an entry to the relational database directory. The entry identifies a remote location, NEW YORK.


Example 3: Adding an Entry for an Application Requester Driver Program

ADDRDBDIRE RDB(YOURRDB) RMTLOCNAME(*ARDPGM)
ARDPGM(MYLIB/MYPGM)

This command adds an entry to the relational database directory. The entry indicates that access to relational database YOURRDB will be done by an application requester driver program named MYPGM in the library MYLIB.


Example 4: Adding an Entry for TCP/IP usage

ADDRDBDIRE RDB(TCPRDB) RMTLOCNAME(ROCHESTER.XYZ.COM *IP)
PORT(*DRDA)

This command adds an entry to the relational database directory. The entry specifies that the remote RDB associated with the RDB name of TCPRDB uses TCP/IP and is on the host with the domain name of ROCHESTER.XYZ.COM, and listens on the standard DRDA port of 446 (*DRDA is the default port so the PORT parameter is unneccessary in this case).


Example 5: Adding an Entry for TCP/IP using Dotted Decimal IP Address and a Numeric Port Number

ADDRDBDIRE RDB(DB2DSYS) RMTLOCNAME(¡¯9.5.36.17¡¯ *IP)
PORT(5021)

This command adds an entry to the relational database directory. The entry specifies that the remote RDB associated with the RDB name of DB2DSYS uses TCP/IP and is on the host with an IP address of 9.5.36.17, and listens on port 5021. A System/390 MVS installation, for example, can have multiple DB2 subsystems, and TCP/IP can support only one server at each port number, so port numbers other than 446 are sometimes required.


Example 6: Adding an Entry for TCP/IP using a Service Name for the Port Identification

ADDRDBDIRE RDB(DB2ESYS) RMTLOCNAME(ROCHESTER.XYZ.COM *IP)
PORT(DB2ESYS_PORT)

This command uses a service name to specify the port number when adding a new entry. OS/400 will attempt to resolve the name DB2ESYS_PORT to a port number by use of the TCP/IP Service Table. In order for the name to be properly resolved, an entry for DB2ESYS_PORT must exist in the TCP/IP Service Table. The WRKSRVTBLE or CFGTCP command can be used to update the service table.