Binding Db2 (required)

Before you can use ZDT/Db2, you must bind the ZDT/Db2 packages and application plans, and grant EXECUTE privilege on these plans to ZDT/Db2 users. The sample jobs shown here are provided in HFM.SHFMSAM1:

The HFM2BNnK jobs must be run once and then rerun when maintenance changes the Db2-specific parts of the product.

It is a requirement that ZDT/Db2 is bound using the DYNAMICRULES(RUN) bind option (the default). The use of DYNAMICRULES(BIND) prevents ZDT/Db2 from being able to dynamically execute SQL statements such as GRANT/REVOKE/ALTER and RENAME, and is therefore not recommended. The DEFINERUN and DEFINEBIND options of the DYNAMICRULES bind option are not supported. See the Db2 Command Reference for the appropriate version of Db2, section "Bind and Rebind options" for a detailed explanation of the DYNAMICRULES bind options.

Select the appropriate bind jobs, depending on the version of the target Db2 system. Run both the "bind plan" and "bind package" jobs, to bind the packages and plans, and to grant the Db2 EXECUTE privilege on the ZDT/Db2 plans to PUBLIC. If you do not grant EXECUTE privilege on the ZDT/Db2 plans to public, you will encounter Db2 authority errors, including SQLCODE-551 errors, when you attempt to run ZDT/Db2.

You must run a version of this job for each Db2 subsystem you want ZDT/Db2 to use, either by direct or remote connection. Select the appropriate bind plan and bind package jobs for each Db2 subsystem you want ZDT/Db2 to use. Refer to the comments in the job for information on modifications you need to make to the job to do this. A return code of 4 is acceptable from this job.

When there are multiple Db2 systems at your site, on possibly different LPARs or different physical machines, and the Db2 systems are configured so that remote access is possible from one Db2 system to another using the Db2 DDF facility, you must ensure that:
  • You run a version of the bind jobs against every Db2 system that ZDT/Db2 will access, either directly or remotely. The HFM2BNnK jobs require access to the DBRMs shipped with the product (in SHFMDBRM). You may need to copy this DBRM library so that the DBRMs are available to the HFM2BNnK jobs when these are run. You need to do this for each LPAR or physical machine where a Db2 system, that ZDT/Db2 is to access, is located.
  • The bind jobs (HFM2BPLN and HFM2BNnK as appropriate) complete successfully; that is the ZDT/Db2 plan and packages are bound correctly. See the comments in the sample bind job for acceptable return codes.
  • EXECUTE privilege on the Db2 plans is successfully granted to PUBLIC. If this step is not successful it is possible that ZDT/Db2 will work correctly when connected to a local Db2 system, but fail when an attempt is made to access a remote Db2 system.

The default ZDT/Db2 plan name is HFM2PLAN. You can change this by modifying HFM2BPLN as appropriate. If you do this, you must change the value for PLAN to your chosen name in your HFM2SSDM macros when you define your Db2 subsystems to ZDT/Db2.

For information about ZDT/Db2 and Db2 subsystems, see Defining all Db2 systems that ZDT/Db2 will access in HFM2POPT (required). For information about the HFM2SSDM macro, see HFM2SSDM.