BIND Plan or BIND Package - A million $ question

I have been asked by most of my developers - " Harsha, should I bind the PLAN after I BIND the package " ? . Well, that depends and DBA's are the most appropriate point of contact to answer such questions.


This post is streamlined for developers and DBA's having 0 % existence of PLAN based DBRM in their shops. Yes, the shop will function with only a PLAN - PACKAGE combination. Why ? - Well, get used to the fact that version 10 is already out there - you have to move on with technology.


I will try to explain this complexity of whether to BIND the PACKAGE or the PLAN in two different scenarios -


Scenario 1 :


I have a new release and I plan to implement a new program PROG001. I plan to map this program under an existing collection ID - COL1.PROG001 so that PLAN001 which is capable of executing all the programs under COL1 collection ID ( COL1.* ) can be made use of. How do I do it ?


Use the below BIND PACKAGE Syntax to perform the BIND :


BIND_Package_COL1


Note the PLAN001 Syntax below generated in the BIND format :


Plan_Syntax_COL1


Note that since you used COL1.PROG001, Plan PLAN001 need/should not be bound again as it already has COL1.* in the PKLIST, so if you execute your program using PLAN001.


Scenario 2 :


I have a new release and I plan to implement a new program PROG002. I plan to use a different PLAN for executing PROG002. Also I want to create a different collection ID COL2 for this program. How do I do it ?


Use the below BIND PACKAGE Syntax :


BIND_Package_COL2


Use the below BIND PLAN Syntax to have a new PLAN, PLAN002 entry in the system and to make use of this plan to execute PROG002 :


Plan_Syntax_COL2


Note that since you created a new program with a new collection ID, none of the PLAN's in your subsystem can be made use of until they are modified/created as they are not designed to make use of your newly created collection ID. As per the requirement you should create a plan which will execute your program as shown above.


Summary :
Developers need not hesitate in asking their DBA's these questions and DBA's should never hesitate in helping them out, after all we all learn together.

2 comments:

  1. A great answer to a really dificult question for developers!! Very good post Sree.

    ReplyDelete
  2. Thank you so much Rubén.. I am glad that you liked it

    ReplyDelete