Installing and setting up Db2 for TDBM and GDBM (Db2-based)

This section describes how to get DATABASE 2™ (Db2®), version 9 or later, running and how to run the LDAP server using the TDBM and GDBM (Db2-based) backend. If TDBM or GDBM (Db2-based) backends are run in 64-bit mode, then Db2 version 9 with PTF UK50918 or Db2 version 10 or later is required. For more information, see IMS in IBM Knowledge Center.

Getting Db2 installed and set up for CLI and ODBC

Following are the steps to get Db2 installed:

  1. Have your database system administrator install Db2, version 9 or later. If running your LDAP server in multi-server mode on multiple images in a parallel sysplex, your administrator must configure a Db2 data sharing group with members on each of the z/OS images on which an LDAP server instance runs. (See Configuring the operational mode for a description of the various operating modes in which the LDAP server may run.)

    Make sure that the SMP/E jobs are a part of the Db2 installation. See the information about installing Db2 CLI in IMS in IBM Knowledge Center. Also, specify the user ID (for example, suxxxx) that should be granted database system administrator authority. This should be the ID you log on with to run the SPUFI jobs to create the Db2 tables for the LDAP server. You must find out the following information from your database administrator:

    • Db2 subsystem name. For example, DSN9.
    • Db2 server location (or data source). For example, LOC1.

    In order to use a local or remote Db2 database, you must include a DDF record in your Bootstrap Data Set (BSDS). That DDF record must include a LOCATION keyword and an LUNAME keyword. If you are using a Db2 database that is on the local system, (including a database that is set up for Db2 data sharing) the DDF component does not need to be started. If you are using a Db2 database that is on a remote system, the DDF component of Db2 must be configured and started on systems using the Db2 Call Level Interface (CLI). CLI is used by the LDAP server for requesting services from Db2. (The Db2 Call Level Interface is IBM®’s callable SQL interface used by the Db2 family of products, based on the ISO Call Level Interface Draft International Standard specification and the Microsoft Open Database Connectivity specification.)

    It might be necessary to have your Db2 administrator set up buffer pools, TEMP space, and TEMP data sets for additional buffer pool sizes. By default, the LDAP server Db2-based backends use buffer pool BP0. The buffer pool choice and size (4K, 32K, or other sizes) should be examined by your database system administrator to ensure that they are large enough to meet the additional needs of the LDAP server, once you have loaded data into its database. The Db2 RUNSTATS utility should be used once data is loaded so that Db2 queries are optimized. See Performance tuning for detailed information about running the Db2 RUNSTATS utility.

    It may also be necessary to have your Db2 administrator increase the configured Db2 limits for MAX USERS and MAX BATCH CONNECT settings to accommodate the resources required by the LDAP server. These settings are controlled by the Db2 subsystem parameters CTHREAD and IDBACK, respectively, by way of installation panel DNSTIPE. For more information about these parameters, see IMS in IBM Knowledge Center. The LDAP server requires the following connections to Db2:
    • two connections for miscellaneous functions
    • one connection for each communication thread, as defined by the commThreads option in the LDAP server configuration file
    • one connection for each program call thread, as defined by the pcThreads option in the LDAP server configuration file
    • one connection for each defined replica object, when basic replication is being used
    • if advanced replication is being used:
      • one connection for each defined replication agreement
      • one connection for each advanced replication plug-in utility operation
      • five connections for system communication for each configured TDBM backend that is used with sysplex data sharing (sysplex threads for TDBM function shifting)
  2. Enter:
    -dsn start db2

    from the image console and wait for Db2 to finish the Db2 initialization. The dsn is the Db2 subsystem name.

    You can stop Db2 by entering:
    -dsn stop db2
    from the console.
    Note: This may already be done when the system is re-ipled.
  3. Edit and Submit DSNHLQ.SDSNSAMP(DSNTIJCL) where DSNHLQ is the high-level qualifier used during Db2 installation. See the information about setting up the Db2 CLI runtime environment in IMS in IBM Knowledge Center. You must run this from the user ID that has been granted the appropriate database authorities. This step establishes the environment needed for the LDAP server to use the CLI. It is often referred to as "binding the CLI plan". When binding the CLI plan, it must be bound using the bind option RELEASE(COMMIT), either by default (when no RELEASE option is specified on the bind statement) or by explicitly specifying the option on the bind statement (see IMS in IBM Knowledge Center for information about bind options and syntax). Note the plan name used when editing this job, for example DSNACLI.
  4. Create (Allocate) the Db2 CLI initialization file. A sample of the CLI initialization file can be found at DSNHLQ.SDSNSAMP(DSNAOINI). Create your own CLI initialization file and copy DSNHLQ.SDSNSAMP(DSNAOINI) into it. If a data set is used for the CLI initialization file, it must not contain sequence numbers. See the information about the Db2 CLI initialization file in IMS in IBM Knowledge Center for more information about the contents of this file. Figure 1 shows a sample file. The example in Figure 1 shows a DSNAOINI file with values based on the examples used in this section. Items in the file that may need to be customized to your Db2 installation are in bold type. See your Db2 administrator for the values of these items for your installation.
    ;This is a comment line...
    ; Example COMMON stanza
    [COMMON]
    MVSDEFAULTSSID=DSN9
     
    ; Example SUBSYSTEM stanza for your DB2 subsystem name
    [DSN9]
    ;MVSATTACHTYPE=CAF
    MVSATTACHTYPE=RRSAF
    PLANNAME=DSNACLI
     
    ; Example DATA SOURCE stanza for your data source
    [LOC1]
    AUTOCOMMIT=0
    CURSORHOLD=0
    CONNECTTYPE=1
    Figure 1. Sample DSNAOINI file

Choosing the MVSATTACHTYPE

The LDAP server can be set up to use either the Call Attachment Facility (CAF) or the Resource Recovery Services attachment facility (RRSAF) to access Db2. See IMS in IBM Knowledge Center for more information about these choices.

Setting AUTOCOMMIT

To prevent data corruption, the LDAP server always uses a value of 0 for AUTOCOMMIT, regardless of the value specified in the DSNAOINI file.