DB2: Local Vs Remote Collections

Recently in our workshop, we faced an issue with switching between two DB2 subsystems. Our data resides in the Legacy DB2 sub-system and New DB2 Sub-system. whenever an old account comes it should point to Legacy DB2, when a new account comes it should point to the New DB2 subsystem.

DB2 Real Concept of DB2 Plans

Explained the real DB2 BIND plan concept.

DB2: Local Vs Remote Collections
DB2: Local Vs Remote Collections

Initially we struggled a lot to understand how this concept works.

Finally we came to know that Plan is fixed and we can switch between collections. Let us see digramatically, how it works. A PLAN can have multiple collections. The collections can be a remote are local.

IBM Reference on Collections and Packages

One important point is there are two ways, we can access remote tables:

  • Aliases can be used point to remote tables (known as “system-directed access”)
  • A local program can issue a CONNECT statement to establish a connection to another DB2 (or non-DB2) location, and execute SQL at the remote location (known as “application-directed access”)

How to add local package list and Remote package list in a collection?

Invoking a package in the other application, We might have our application defined in Production as simply as this:

PKLIST(FIN_PROD_CICS.*)

We can include code from the Payroll application in the plan (support must also be provided in the load library hierarchy):

PKLIST(FIN_PROD_CICS.*, PAY_PROD_CICS.*)

A call from a Financial program to a Payroll program allows DB2 to load the package associated with the Payroll program successfully as it finds the package in the FIN_PROD_CICS collection.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.