Binding Db2® (required)

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

  • FMN2BN0P Db2® V10 binds the FM/Db2 plans (run once).
  • FMN2BN0K Db2® V10 binds the FM/Db2 packages.
  • FMN2BN1P Db2® V11 binds the FM/Db2 plans (run once).
  • FMN2BN1K Db2® V11 binds the FM/Db2 packages.
  • FMN2BN2P Db2® V12 binds the FM/Db2 plans (run once).
  • FMN2BN2K Db2® V12 binds the FM/Db2 packages.

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

Note: File Manager provides sample bind jobs only for supported versions of Db2® running in new-function mode (NFM).
Attention: The packages used in File Manager version 14 are different to previous File Manager versions. Re-running the bind jobs derived from an earlier version of File Manager will not work.

It is a requirement that FM/Db2 is bound using the DYNAMICRULES(RUN) bind option (the default). The use of DYNAMICRULES(BIND) prevents FM/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.

In FMN2BNnK you will see that the members bound into the packages are called ADBxxxx. These members are aliases of DBRMs and are provided in FMN.SFMNDBRM.

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 FM/Db2 plans to PUBLIC. If you do not grant EXECUTE privilege on the FM/Db2 plans to public, you will encounter Db2® authority errors, including SQLCODE-551 errors, when you attempt to run FM/Db2.

You must run a version of this job for each Db2® subsystem you want FM/Db2 to use, either by direct or remote connection. Select the appropriate bind plan and bind package jobs for each Db2® subsystem you want FM/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 FM/Db2 will access, either directly or remotely. The FMN2BNnK jobs require access to the DBRMs shipped with the product (in SFMNDBRM). You may need to copy this DBRM library so that the DBRMs are available to the FMN2BNnK jobs when these are run. You need to do this for each LPAR or physical machine where a Db2® system, that FM/Db2 is to access, is located.
  • The bind jobs (FMN2BNnP and FMN2BNnK as appropriate) complete successfully; that is the FM/Db2 plans and packages are bound correctly. See the comments in the FMN2BIND job, for the appropriate version of Db2®, 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 FM/Db2 will work correctly when connected to a local Db2® system, but fail when an attempt is made to access a remote Db2® system.

You can change the plan names for the FM/Db2 plan and the FM/Db2 reverse engineering plan. To do this modify FMN2BNnP as appropriate. The default names for these plans are FMN2PLAN and FMN2GEN respectively. If you choose to change these plan names, you must change the values for PLAN and PLAN2 to your chosen names, in your FMN2SSDM macros, when you define your Db2® subsystems to FM/Db2.

For information about FM/Db2 and Db2® subsystems, see Defining all Db2 systems that FM/Db2 will access in FMN2POPT (required). For information about the FMN2SSDM macro, see FMN2SSDM.