DB2 Bind
DB2 Bind
DBRM to be bound is given in MEMBER and the partitioned dataset containing the
DBRM is given in LIB. During BIND Package, if an existing package is used to create the
new package then, COPY should be mentioned instead of MEMBER and LIBRARY.
COPY(collection-id.package-id)
are named here. PKLIST (COLL1.*) bound all the packages with collection ID COLL1 to
the PLAN.
VERSION. With packages, the pre-compiler option VERSION can be used to bind multiple
With VERSION(TEST)
-------- > Pre-compile ----------- BIND Package --------COLL1.PROG.PROD
With VERSION(PROD)
REPLACE will replace an existing package with the same name, location and collection.
Syntax: ACTION(ADD|REPLACE)
bound to this package can be isolated from the effects of other programs running. This
CURSOR STABILITY (CS)– As the cursor moves from the record in one page to the record
in next page, the lock over the first page is released (provided the record is not updated). It
avoids concurrent updates or deletion of row that is currently processing. It provides WRITE
integrity.
REPEATABLE READ (RR) – All the locks acquired are retained until commit point. Prefer
this option when your application has to retrieve the same rows several times and cannot
tolerate different data each time. It provides READ and WRITE integrity.
UNCOMMITTED READ (UR) – It is also known as DIRTY READ. It can be applied only
for retrieval SQL. There are no locks during READ and so it may read the data that is not
committed. Highly dangerous and use it when concurrency is your only requirement. It finds
its great use in statistical calculation of the large table and data-warehousing environment.
when it executes an SQL statement that references a table in the table space and it release the
acquired lock on COMMIT or ROLLBACK. This is the default option and provides greater
concurrency.
the program thread, it imposes lock over all the tables and table spaces used by the program.
This option avoids deadlocks by locking your source at the beginning but it reduces
concurrency.
SQLERROR (NOPACKAGE) – Default - If there is any SQL error, package will not be
created.
SQLERROR (CONTINUE) – Create the Package even if SQL errors are encountered.
It controls the handling of ‘object not found’ and ‘not authorized’ errors.
Default is VALIDATE (RUN) – If all objects are found and all privileges are held, then don’t
check once again at execution time. If there is any ‘privilege issue’ or ‘object not found’
error, then produce WARNING messages, bind the package and check authorization and
ERROR message and create the package only if SQLERROR(CONTINUE) is coded in bind
Qualifiers are added at the bind time to the objects used in the program.
It is suggested NOT to use any qualifiers in the program and use this parameter during BIND
so that the program can be easily promoted from one region to next region without any
change in program.
REBINDING
When SQL statements are not changed but a new index is added or RUNSTATS is
run, then it is advisable to do a REBIND for the best possible access path. REBIND PLAN is
REBIND PLAN(PLAN-NAME)
VALIDATE(BIND)
…..