What is the difference between package and plan?

Showing Answers 1 - 12 of 12 Answers

The main difference between Plan and package lies with the time. When a DBRM undergoes the bind process, the outcome in earlier days was called as a Plan and nowadays it can either be a Plan or a package. So, plan was what existed prior to DB2 V2R3 and the concept of binding a DBRM into a package came later.  Remember,  Plan does have the "member list" of the DBRMs in the programs of an application.

Plan / package contain the run-time instructions for the SQL statements in the program.  For applications with more than 100 modules,  there arise a need for binding the whole plan for a simple change in one of these modules. Apparently, there needs to be a change in the run-time instructions for one module but with the old process, we will have to bind all the 100+ DBRMs to come up with a latest PLAN.

So, the concept of Package was introduced. In this, the all the DBRMs are bound into packages. And, the packages for an application APP with 100+ called programs, needed a list of packages being used by its programs.  This modified the concept of Plan and redefined Plan as a "searchlist for the packages".  A plan was redefined as an access path to a package.

 

  Was this answer useful?  Yes

sam117

  • Dec 25th, 2009
 

Package can be bound for single DBRM only. Plan can contain both DBRM and Packages. Packaqes can't be executed until they are bound into a plan. 

the difference is that a Package is at a more granular level. If a module is bound to a Package, any change in module requires only the Package to be re-bound, without the necessity to re-bind the entire plan to which the package is associated . Package can be bound only to one DBRM

Plan can be

1) Bound to N number of DBRMs
2) Bound to N number of Packages
3) Bound to N number of packages and DBRM combination (e.g. 3 DBRMS and 4 Packages bound to a single Plan)

so, if 100 DBRM modules are bound directly to a single Plan, (without binding to a PACKAGE), a single change to any 1 of them will require entire PLAN to be re-bound. (i.e. all, even unchanged DBRMs, to be re-bound to the Package). This is not the case with Package

Also, mostly Packages are non-executable whereas PLAN is executable as PLAN is required (invertible) at run-time along with Load Module. (remote packages are an exception as when using DDF, the remote modules must be bound to packages, directly binding them to plan is not permitted if they are being used in a Distributed Data Facility)

  Was this answer useful?  Yes

kamalbasha

  • Nov 26th, 2015
 

The main difference between the plan and package is in db2+cobol pogramm we undergo precompilation because the compiler could not understand the statements are in between EXEC and END-EXEC so we go for the precompilation in this process we get DBRM which contains SQL statements and this statements will go for bind process means optimization. after it will go for package means which is not executable. Then plan is a optimised SQL statements which are in executable form.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions