0% found this document useful (0 votes)
105 views

DB2 Bind

This document discusses various parameters used during the DB2 bind process. It describes parameters such as MEMBER, LIBRARY, PKLIST, ACTION, ISOLATION LEVEL, ACQUIRE, RELEASE, SQLERROR, VALIDATE and EXPLAIN that control how packages are created and customized during binding. It also covers topics like package naming conventions, using VERSION for multiple versions, and when to perform a rebind versus a full bind.

Uploaded by

Sunil Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

DB2 Bind

This document discusses various parameters used during the DB2 bind process. It describes parameters such as MEMBER, LIBRARY, PKLIST, ACTION, ISOLATION LEVEL, ACQUIRE, RELEASE, SQLERROR, VALIDATE and EXPLAIN that control how packages are created and customized during binding. It also covers topics like package naming conventions, using VERSION for multiple versions, and when to perform a rebind versus a full bind.

Uploaded by

Sunil Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Bind Parameter – MEMBER and LIBRARY

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)

COPYVER(version-id) – version of the copy to be used. Default is empty if omitted.

Bind Parameter – PKLIST

PKLIST is a BIND parameter of BIND PLAN. Packages to be connected with PLAN

are named here. PKLIST (COLL1.*) bound all the packages with collection ID COLL1 to

the PLAN.

Package Naming – Collection-ID and Versioning

Packages have three qualifiers. Location ID is used in distributed environment.

Collection ID is used for grouping of packages.

Naming Syntax: Location-id. Collection-id. Package-name

VERSION. With packages, the pre-compiler option VERSION can be used to bind multiple

versions of the programs into package.

PROG-------- > Pre-compile ----------- BIND Package --------COLL1.PROG.TEST

With VERSION(TEST)
-------- > Pre-compile ----------- BIND Package --------COLL1.PROG.PROD

With VERSION(PROD)

Bind Parameter – ACTION

Package or Plan can be an addition or replacement. Default is replacement.

REPLACE will replace an existing package with the same name, location and collection.

REPLVER(version-id) will replace a specific version of an existing package.

ADD – Add the new package to SYSIBM.SYSPACKAGE.

Syntax: ACTION(ADD|REPLACE)

Bind Parameter – Isolation Level


The isolation level parameter of the BIND command describes to what extent a program

bound to this package can be isolated from the effects of other programs running. This

determines the duration of the page lock.

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.

Bind Parameter – ACQUIRE and RELEASE


ACQUIRE(USE) and RELEASE(COMMIT) – DB2 imposes table or table space lock

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.

ACQUIRE(USE) and RELEASE(DEALLOCATE) – Locks table and table spaces on

use and releases when the plan terminates.

ACQUIRE(ALLOCATE) and RELEASE(DEALLOCATE) – When DB2 allocates

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.

ACQUIRE(ALLOCATE) and RELEASE(COMMIT) is NOT ALLOWED. This

increases the frequency of deadlocks.


Bind Parameter – SQLERROR

It says whether to create the package in case of SQL errors.

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.

Bind Parameter – VALIDATE

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

existence at execution time.

VALIDATE (BIND) – If there is any privilege or object-not-found issue, then produce

ERROR message and create the package only if SQLERROR(CONTINUE) is coded in bind

card. The statement in error will not be executable.


BIND Parameter – EXPLAIN

EXPLAIN(YES) loads the access path selected by the optimizer in PLAN_TABLE.

EXPLAIN(NO) is default and it wont load any such details in PLAN_TABLE.

BIND Parameter – QUALIFIER

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

cheaper than BIND with ACTION (REPLACE).

SYSTSIN CARD should be

REBIND PLAN(PLAN-NAME)

VALIDATE(BIND)

…..

You might also like