Difference between DB2 Plan, Package and Collection ID

Thiyagarajan Srinivasan

Difference between DB2 Plan, Package and Collection ID

Could someone explain me about the relationship among DB2 plan , package and collection ID?

I know that Plan is executable and can contains package and/or DBRM in it. Also, if there is any changes in the program then the particular package to be rebound and the plan to be untouched. Below are my questions regarding Plan , Package and Collection ID

  1. Since both plan and package can be bound and create the access path, why can't the packages to be executable? What will happen when we bind package and try to execute via package?
  2. If only packages to be rebound and plan can be untouched for changes in a program, How exactly the plan works with the rebound packages?
  3. Can the package have more than a DBRM?
  4. Can one DBRM resides in many packages?
  5. What is the relationship between Package and collection ID? Can’t we execute the plan directly via package? What is the advantage of collection ID in the COBOL-DB2 execution?