I have created a cobol-db2 program, when I compiled it , a plan was automatically created. I use the same plan to execute the program. My doubt is , why do we go for a package, as it is better to have one plan for each program. Can anybody pls clarify my doubt??
Joined: 06 Sep 2007 Posts: 788 Location: Chennai, India
I got this from IBM library.
Should I use packages or bind directly to the plan?
Use packages. Plans containing a DBRM are currently deprecated. Using packages has the following advantages:
1. When you change one SQL statement, you do not need to bind the entire plan again. You need to bind only the package that is associated with the changed SQL statement.
2. Binding packages into package collections enables you to add packages to an existing application plan without having to bind the entire plan again.
3. Maintaining several versions of a plan without using packages requires a separate plan for each version, and therefore separate plan names and run commands. Isolating separate versions of a program into packages requires only one plan and simplifies program migration and fallback for separate development, test, and production levels of a program.
For plans that are bound with only one DBRM, packages still offer the advantage of versioning. However, for plans that use multiple DBRMs, you should probably bind each DBRM into a package, and then bind the packages into the plan.
Plans containing DBRMs and the BIND ACQUIRE(ALLOCATE) option are still included in DB2 9, but may be removed from future versions. Use packages and ACQUIRE(USE) to replace the existing function. We expect to deliver some help in migration, but packages are the strong recommendation.