Preparing the Db2 Environment

How to:

The Adapter for Db2 minimally requires the installation of the Db2 Client for the CLI type adapter or the Db2 load library for the CAF adapter. The Db2 Client allows you to connect to a local or remote Db2 server.

Procedure: How to Set Up the Environment on Microsoft Windows

On Microsoft Windows, the Db2 environment is set up during the installation of Db2 client.

The adapter supports Unicode data. You must add DB2CODEPAGE=1208 to the Windows environment either by:

  • Setting the environment variable in Windows.
  • Setting the environment variable in the edaenv.cfg file.
DB2CODEPAGE=1208

Procedure: How to Set Up the Environment on UNIX

On UNIX, to set up the Adapter for Db2, do the following:

  • Specify the Db2 instance to access using the UNIX environment variable $DB2INSTANCE. For example:
    export DB2INSTANCE=db2
  • Specify the location of the Db2 instance you wish to access using the UNIX environment variable $INSTHOME:
    export INSTHOME=/usr/db2
  • Specify the path to the Db2 shared library using the UNIX environment variable $LD_LIBRARY_PATH. For example:
    export LD_LIBRARY_PATH=$INSTHOME/sqllib/lib:$LD_LIBRARY_PATH

    Note that if the server is running with security on, the LD_LIBRARY_PATH variable is ignored. In this case, you must use IBI_LIBPATH.

  • Unicode support. The adapter supports Unicode data. You must set the LANG environment variable in the edastart file or in a separate shell file. For example, for American English, you would export the following variable:
    export LANG=EN_US.UTF-8

    To take advantage of adapter support for Unicode data, the Reporting Server must be configured with code page 65001.

Procedure: How to Set Up the Environment on z/OS

Two types of Adapters for Db2 are available in this environment. Each one requires different pre-configuration steps prior to using the Web Console.

  • Db2/CAF: Utilizes embedded SQL using the IBM/Db2 for z/OS Call Attach Facility to access the Db2 RDBMS.
    • For HFS deployment. The Web Console configuration panel for the bind operation has three options (Yes, Create JCL only, and No). Select Yes to execute a shell script ($EDAHOME/bin/genidb2.sh) to bind your plan to Db2. If you do not have bind authority over the Db2 subsystem, then select Create JCL only so that your Db2 DBA can run member GENDB2 in the configuration data set for you. Select No if you do not want to run the bind script or create the JCL. The Adapter for Db2 can now be used.
    • For PDS deployment. The Web Console configuration panel for the bind operation will only create the JCL member GENDB2 in the configuration data set. This job will have to be submitted by your Db2 DBA to bind the plan to Db2 before the Db2 adapter can be used.

    For the naming convention for the configuration data set, see the installation manual for z/OS.

  • Db2/CLI: Utilizes IBM/Db2 for z/OS Call Level Interface calls to access the Db2 RDBMS.

    The adapter makes use of the Db2 plan DSNACLI. To ensure that all users of the adapter have access to this plan, issue the following command in the Db2 environment:

    GRANT EXECUTE ON PLAN DSNACLI TO PUBLIC

    The adapter also uses the DSNAOINI environment variable or DSNAOINI DDNAME pointing to the Db2 CLI initialization file. You can provide this variable at installation time using the ISETUP panels, or you can add the variable manually to the EDAENV member of the installation data set after completing the installation.

    The following is an example for the DSNAOINI environment variable.

    DSNAOINI=full_path_name/db2cli.ini

    The following is an example for the DSNAOINI DDNAME.

    //DSNAOINI DD DSN=library(member),DISP=SHR

    or

    //DSNAOINI DD DSN=dataset,DISP=SHR

    Unicode support. The adapter supports Unicode data in Db2 databases that have been created with the CCSID UNICODE option. You must ensure that the DSNAOINI environment variable or DDNAME points to a configuration file containing the following specification:

    CURRENTAPPENSCH=UNICODE

Procedure: How to Access a Remote Database Server on IBM i

Using the standard rules for deploying the Db2 Client, the server supports connections to:

  • Local Db2 servers.
  • Remote Db2 servers.

When using Db2/CLI to connect to a remote Db2 data source, the Db2 client catalog must contain an entry for the node where the remote data source resides and an entry for the remote database name.

Support for Remote Aliases. An alias entry in a local Db2 system that points to a table in another Db2 system is only supported with the CREATE SYNONYM command. It is not supported for metadata queries when SET ENGINE=DB2 is in effect.

WebFOCUS

Feedback