Difference between Package and Plan in DB2.

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
Ruchi2 T
New Member
Posts: 2
Joined: Tue Aug 12, 2014 4:26 pm

Difference between Package and Plan in DB2.

Post by Ruchi2 T »

Hi,

I know that Package is the executable access path code for the sql statements in the DBRM while plan contains package list which is nothing but pointers to packages. But they were same long back, so for the binding process, is there a difference between binding Package and binding a Plan?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Difference between Package and Plan in DB2.

Post by nicc »

But they were same long back
No they were not - "long back" (I assume you mean back in time) packages did not exist and were introduced to better handle some of the intricacies of application design.
Regards
Nic
Ruchi2 T
New Member
Posts: 2
Joined: Tue Aug 12, 2014 4:26 pm

Re: Difference between Package and Plan in DB2.

Post by Ruchi2 T »

Yea, I meant that. Is there a difference in saying "long back" and "back in time"??

But back to my question... is there a difference between binding Package and binding a Plan?
User avatar
Akatsukami
Global Moderator
Global Moderator
Posts: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: Difference between Package and Plan in DB2.

Post by Akatsukami »

Absolutely; packages have a one-to-one relationship to source modules. A plan is a group of packages; it will correspond to one or more load modules.
"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli
User avatar
Anuj Dhawan
Founder
Posts: 2816
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Difference between Package and Plan in DB2.

Post by Anuj Dhawan »

is there a difference between binding Package and binding a Plan?
When you write a BIND parameters for PALN or PACKAGE, you can specify many bind parameters in DB2. Among them, some of them are for PLANs, some are for PACKAGEs and some are for both. Some are for PACKAGEs and triggers. Which object type you’re attempting to bind controls which parameters you can work with. But, as such, the command spells the same.

The bind process, BIND PLAN or BIND PACKAGE, establishes a relationship between an application program and its relational data. This step is necessary before you can execute your program. DB2 allows you two basic ways of binding a program: to a package, or directly to an application plan - as you've also stated about it in your question itself.

A package is an executable representation of a single DBRM. The story about PLANs goes back to the era when the DBRMs, representing the programs, linked into a single load module were all bound into a single plan. A single DBRM is changed and the entire plan had to be bound. If the DBRM was used in more than one plan, all plans containing that DBRM had to be bound. Depending on the number of DBRMs included in a plan, this could be a lengthy, disruptive process. We needed something to solve it and PACKAGEs came to rescue. I think this all should be enough for that one line of statement quoted above, yes/no? :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DB2 and IMS DB/DC”