Attaching to a remote server in the LDAP environment

In the LDAP environment, you can attach to a remote database server using the LDAP node name on the ATTACH command: db2 attach to ldap_node_name.

About this task

When a client application attaches to a node or connects to a database for the first time, since the node is not in the local node directory, the database manager searches the LDAP directory for the target node entry. If the entry is found in the LDAP directory, the protocol information of the remote server is retrieved. If you connect to the database and if the entry is found in the LDAP directory, then the database information is also retrieved. Using this information, the database manager automatically catalogs a database entry and a node entry on the local computer. The next time the client application attaches to the same node or database, the information in the local database directory is used without having to search the LDAP directory.

A caching mechanism exists so that the client searches the LDAP server only once. After the information is retrieved, it is stored or cached on the local computer based on the values of the dir_cache database manager configuration parameter and the DB2LDAPCACHE registry variable.
  • If DB2LDAPCACHE=NO and dir_cache=NO, then always read the information from LDAP.
  • If DB2LDAPCACHE=NO and dir_cache=YES, then read the information from LDAP once and insert it into the Db2® cache.
  • If DB2LDAPCACHE=YES or is not set, then read the information from LDAP server once and cache it into the local database, node, and DCS directories.
Note: The caching of LDAP information is not applicable to user-level CLI or Db2 profile registry variables.