Previous Topic: DB2 and JDBC

Next Topic: DB2 Versions and JDBC Drivers


How to Implement DB2 with ReportCenter

You must complete the following tasks to implement a DB2/ReportCenter environment. The tasks can be completed in any order.

Create the DB2 ReportCenter Database

The JCL required to define the ReportCenter database to DB2 is supplied with your CA NetMaster product. If you are using ReportCenter for the first time, you must create this database.

Important! When you create the database, you need to customize some WRDB2* members. Do not edit them directly. These members are maintained by SMP/E; therefore, future maintenance overwrites your changes. Copy these members to another data set before editing.

Create the Database

The database is empty to start, ready to store the reporting data that you collect from your ReportCenter data regions. You can run reports against the database by using the ReportCenter Reports option in WebCenter.

The database table qualifier can be any valid value, though many users use the database schema name. ReportCenter uses only the database table qualifier: it does not know or need to know the schema name.

To create the ReportCenter DB2 database

  1. Locate and copy the dsnpref.NMC1.CC2DSAMP(WRDB2CRE) data set member. This job executes the DB2 batch plan (DSNTIAx1), which creates the tables and indexes, and primes the Keyrange table with initial values.
  2. Edit your copy of WRDB2CRE, as instructed at the top of the member.
  3. Use your ReportCenter implementation worksheet to record your database table qualifier. You need this when you customize your ReportCenter control region.
  4. Submit the job. The expected return code is 0.

Grant Access to the Database

The ReportCenter Java Task accesses the databases. The database user is the CA ACF2, CA Top Secret, or RACF user ID that owns the ReportCenter Java Task.

To grant database access to the ReportCenter applications

  1. Locate and copy the dsnpref.NMC1.CC2DSAMP(WRDB2GRA) data set member.
  2. Review the security requirements and sample GRANT commands in this member.

    Note: Security for DB2 is complex. The sample GRANT statements are intended only as a guide. You must get them reviewed and approved, or modified by your DBA or DB2 security specialist because they may have their own way of implementing the ReportCenter security requirements. Ensure that you do not violate any of the authorization standards at your installation.

  3. Edit your copy of WRDB2GRA to conform to your authorization standards.
  4. Use the SPUFI facility or an equivalent utility to run the commands in your WRDB2GRA member.

All steps should complete with Condition Code 0; however, it depends on whether users already have permissions for the same plans and tables.

Note: You must have SYSADM authority to issue some GRANT commands.

Verify Connectivity to a Remote Database

If ReportCenter needs to access a remote DB2 database (that is, a DB2 subsystem that runs in a different LPAR to the ReportCenter Java Task), that remote DB2 must be configured to accept TCP/IP requests from clients. This is done using the Distributed Data Facility (DDF) of DB2 for z/OS.

The TCP/IP hostname and port used by DDF is written to the joblog and the MVS console at startup. Look for a message similar to the following:

DSNL519I  D81A DSNLIRSY TCP/IP SERVICES AVAILABLE
           FOR DOMAIN yourhost.yourname.com AND PORT 5142

The values of the IP hostname, port, and DB2 subsystem location name are needed to construct the URL required for Universal Driver Type 4 Connectivity. You enter this URL when you customize your ReportCenter regions.

Install and Set Up JDBC for DB2

The DB2 JDBC environment is installed separately from the CA NetMaster product installation and setup steps. JDBC support for DB2 is supplied as an optional component of DB2 UDB. This component may already be installed on your system:

Component Name: 'DB2 ODBC/JDBC/SQLJ'
Component: 5740XYR02
Versions: 710, 810, and 910

To perform the installation steps, see the IBM publication, Application Programming Guide and Reference for Java for your version of DB2 UDB.

Notes:

Important! To successfully implement JDBC for DB2, you must install the JDBC software and then perform all of the other required configuration steps. Installing the JDBC software alone is not sufficient.

How to Implement DB2 JDBC

To implement DB2 JDBC for ReportCenter, you must do the following:

Install the JDBC and SQLJ Libraries

Note: For information about loading the JDBC and SQLJ libraries, see IBM's Application Programming Guide and Reference for Java.

This step performs the SMP/E installation of the DB2 JDBC/SQLJ component. This component comprises HFS and SMP/E target libraries. Use your ReportCenter implementation worksheet to record the names of the target library HFS path names and data sets. You need them in later steps.

If the DB2 JDBC/SQLJ component is installed, you do not need to install it again; however, you should carefully review the following steps to ensure that your existing DB2 JDBC environment will work with ReportCenter.

Use your ReportCenter implementation worksheet to record the full path of the following file:

You must enter this path when you enable ReportCenter on your ReportCenter control region for the first time.

It is not necessary to set the program control extended attribute for ReportCenter.

Note Environment Variable Values

Environment variables are used to communicate site-specific information about your system setup, such as search paths and file names, to processes that run in the UNIX System Services environment, such as the ReportCenter Java Task.

Ask your DBA and systems programmer for the values to use for the JDBC environment variables required by ReportCenter.

Important! Most ReportCenter Java Task operational problems are due to the omitted, incomplete, or inexact setting of USS environmental variables. Care taken with this step can avoid many problems later.

For information about the USS environmental variables that must be set for DB2 JDBC access, see IBM's Application Programming Guide and Reference for Java.

The JDBC drivers require the following environment variables to be set correctly. Obtain these values from your systems programmer or DBA and note them in your ReportCenter implementation worksheet because you need them when you customize your ReportCenter control region.

CLASSPATH

Specifies where to find Java classes. Must include the full path name of the JDBC classes file, for example:

Legacy Driver
/usr/lpp/db2/db2810/classes/db2j2classes.zip
Universal Driver
/usr/lpp/db2910_jdbc/classes/db2jcc.jar: \ /usr/lpp/db2910_jdbc/classes/db2jcc_javax.jar: \ /usr/lpp/db2910_jdbc/classes/sqlj.zip: \ /usr/lpp/db2910_jdbc/classes/db2jcc_license_cisuz.jar
PATH

Specifies where to find commands. Must include the Java command directory, for example:

/usr/lpp/java/J1.4/bin
LIBPATH

Specifies where to find DLLs. Must include JDBC DLL directory, for example:

/usr/lpp/db2/db2810/lib
LD_LIBRARY_PATH

Specifies where to find files required by the dynamic linker and loader. Must include JDBC DLL directory, which also contains linker and loader files, for example:

/usr/lpp/db2/db2810/lib
DB2SQLJPROPERTIES

Specifies where to find the JDBC run-time properties. Must be set to full path name of JDBC run-time properties file, for example:

/usr/lpp/db2/db2810/classes/db2sqljjdbc.properties

or

/usr/lpp/db2/db2910/classes/DB2JccConfiguration.properties

Note: The name of the properties file may need to follow a pattern. For more information, see your IBM documentation.

STEPLIB

Specifies where to find DB2 load modules. Must be a concatenation of the DB2 SDSNEXIT, SDSNLOAD, and SDSNLOD2 load library data set names.

After you customize your ReportCenter control region, it generates a .bat file that invokes the ReportCenter Java Task. This file sets the values of these variables for the Java Task.

Customize Parameters in the SQLJ/JDBC Run-time Properties File

The universal driver properties file is a flat text file that is defined to a ReportCenter Java Task using its DB2SQLJPROPERTIES variable in Adaptor.bat. The properties defined in the file affect any use of the universal driver by ReportCenter. This properties file is not required, but is recommended by IBM because it can be used to override DB2 default values.

Note: For information about customizing parameters in the SQLJ/JDBC run-time properties, see IBM's Application Programming Guide and Reference for Java, which describes the parameters that can be set in this file.

ReportCenter requires the following parameters:

DB2SQLJSSID=?db2-subsystem-name
DB2SQLJMULTICONTEXT=YES
DB2SQLATTACHTYPE=RRSAF 
DB2SQLJDBRMLIB=?dbrm-data-set

Review the remaining parameters, as applicable to your environment.

For the Legacy JDBC driver, the default path name for the SQLJ/JDBC run-time properties file looks similar to the following:

/usr/lpp/db2/db2810/classes/db2sqljjdbc.properties

If you use a new path name for your customized run-time properties file, you must specify that file name in the ReportCenter Customizer parameter group. The Customizer uses it to set the DB2SQLJPROPERTIES environment variable.

For the Universal JDBC Driver, a properties file is optional.

DB2SQLJSSID Parameter

If you use the Universal JDBC driver and do not specify a properties file, be aware of where the default processing sets the SSID property from. SSID specifies the DB2 subsystem identifier (not location name) that the Universal JDBC driver uses.

In some cases, if this is not explicitly specified, the driver may use the subsystem identifier specified in the DSNDECP load module. For this reason, if you use Type 4 Connectivity to access a remote DB2 on another LPAR, you need a properties file that specifies the DB2SQLJSSID name on the other LPAR.

Unspecified, defaulted and incorrect SSID values are the cause of many implementation problems with ReportCenter and the Universal JDBC Driver. For more information, see the IBM Universal JDBC Driver documentation.

DB2SQLJDBRMLIB Parameter

The library name that you enter here is obtained from your Database Administrator. When the SQLJ/JDBC profile is customized in the following step, it writes four Database Request Modules (DBRMs) to the file you specify here.

These DBRMs are then bound by the DBA using a DB2 batch job supplied by IBM. The plan name DSNJDBC is created by this batch job. This plan must be given EXECUTE access to PUBLIC by the DBA.

Note: This library is required only if you are generating a LEGACY driver. For the UNIVERSAL driver, it is not necessary to bind your JDBC packages into a plan.

DB2SQLATTACHTYPE Parameter

ReportCenter uses only an ATTACHTYPE of RRSAF. Alternate attach mechanisms, such as the Call Attach Facility (CAF) or CLI do not support the multithreading requirements of ReportCenter.

The Resource Recovery Manager Services and the z/OS System Logger must be configured to enable the JDBC driver to use the underlying Resource Recovery Services Attachment Facility (RRSAF).

For more information about configuring the Resource Recovery Manager Services Attachment Facility, see the Application Programming and SQL Guide for your version of DB2 for z/OS.

Note: ReportCenter does not require customization of the cursor properties file.

Set Up RRS Security Definitions

Check your operational procedures to ensure that the started task Resource Recovery Services (RRS) is always active, in addition to your DB2 subsystem.

ReportCenter works with DB2 subsystems in local or sysplex mode. DB2 JDBC support requires RRS with at least a monoplex defined, that is, a sysplex configuration of monoplex or multisystem. An RRS configuration of xcflocal does not support JDBC for DB2.

Your Security Administrator must define the resources and permissions required for your DB2 subsystem to use RRS, if these have not been defined already.

More information:

Security Definitions for RRS and DB2

Perform Other Driver-Specific Steps

Perform other tasks as directed by the specific IBM documentation about implementing the Legacy or Universal JDBC drivers.

These may include tasks such as generating JDBC profile files, binding DBRMs, and so on.

For the same tasks, different OMVS utilities may be invoked by the Legacy (Db2JDBCgen) and Universal (DB2Binder) drivers.

Note: If you are implementing the Universal Driver, different steps may be required for Type 2 Connectivity and Type 4 Connectivity. Follow the ones appropriate to what your database administrator has chosen.

Grant Access to DB2 JDBC

After you successfully complete the steps above, your Database Administrator must grant access to DB2 JDBC functions, by issuing the following command:

GRANT EXECUTE ON PLAN DSNJDBC TO PUBLIC;