DB2 10.5 for Linux, UNIX, and Windows

sqlectnd API - Catalog an entry in the node directory

Stores information in the node directory about the location of a DB2® server instance based on the communications protocol used to access that instance. The information is needed to establish a database connection or attachment between an application and a server instance.

Authorization

One of the following authorities:
  • SYSADM
  • SYSCTRL

Required connection

None

API include file

sqlenv.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  sqlectnd (
        struct sqle_node_struct * pNodeInfo,
        void * pProtocolInfo,
        struct sqlca * pSqlca);

SQL_API_RC SQL_API_FN
  sqlgctnd (
        struct sqlca * pSqlca,
        struct sqle_node_struct * pNodeInfo,
        void * pProtocolInfo);

sqlectnd API parameters

pNodeInfo
Input. A pointer to a node directory structure.
pProtocolInfo
Input. A pointer to the protocol structure:
  • SQLE-NODE-LOCAL
  • SQLE-NODE-NPIPE
  • SQLE-NODE-TCPIP
pSqlca
Output. A pointer to the sqlca structure.

Usage notes

DB2 creates the node directory on the first call to this API if the node directory does not exist. On the Windows operating system, the node directory is stored in the directory of the instance being used. On Linux and UNIX operating systems, it is stored in the DB2 install directory (sqllib, for example).

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 may not be effective until the application has restarted. To refresh the shared cache (server only) in DB2, stop (db2stop command) and then restart (db2start command) the database manager. To refresh the directory cache for another application, stop and then restart that application.

REXX API syntax, option 1

CATALOG LOCAL NODE nodename INSTANCE instance_name [WITH comment]

REXX API parameters, option 1

nodename
Alias for the node to be cataloged.
instance_name
Name of the instance to be cataloged.
comment
An optional description associated with this node directory entry. Do not include a CR/LF character in a comment. Maximum length is 30 characters. The comment text must be enclosed by double quotation marks.

REXX API syntax, option 2

CATALOG NPIPE NODE nodename REMOTE computer_name INSTANCE instance_name

REXX API parameters, option 2

nodename
Alias for the node to be cataloged.
computer_name
The computer name of the node on which the target database resides.
instance_name
Name of the instance to be cataloged.

REXX API syntax, option 3

CATALOG TCPIP NODE nodename REMOTE hostname SERVER servicename
[WITH comment]

REXX API parameters, option 3

nodename
Alias for the node to be cataloged.
hostname
Host name or IPv4 address or IPv6 address of the node where the target database resides
servicename
Either the service name of the database manager instance on the remote node, or the port number associated with that service name.
comment
An optional description associated with this node directory entry. Do not include a CR/LF character in a comment. Maximum length is 30 characters. The comment text must be enclosed by double quotation marks.

REXX API syntax, option 4

CATALOG TCPIP4 NODE nodename REMOTE hostname SERVER servicename
[WITH comment]

REXX API parameters, option 4

nodename
Alias for the node to be cataloged.
hostname
Host name or IPv4 address or IPv6 address of the node where the target database resides
servicename
Either the service name of the database manager instance on the remote node, or the port number associated with that service name.
comment
An optional description associated with this node directory entry. Do not include a CR/LF character in a comment. Maximum length is 30 characters. The comment text must be enclosed by double quotation marks.

REXX API syntax, option 5

CATALOG TCPIP6 NODE nodename REMOTE hostname SERVER servicename
[WITH comment]

REXX API parameters, option 5

nodename
Alias for the node to be cataloged.
hostname
Host name or IPv4 address or IPv6 address of the node where the target database resides
servicename
Either the service name of the database manager instance on the remote node, or the port number associated with that service name.
comment
An optional description associated with this node directory entry. Do not include a CR/LF character in a comment. Maximum length is 30 characters. The comment text must be enclosed by double quotation marks.