BIND & REBIND are the two options provided in DB2 for the re-evaluation of access path.
REBIND searches the catalog,takes the information found there and re-evaluates the access path.
BIND being more enhanced operation performs a lots of checks (correct syntax,whether all tables are existing or not ,proper grants are provided or not) and then re-evaluates the access path.
Both BIND & REBIND basically checks for the dependency of the objects referenced in the package.
In a package suppose n number of objects are referenced and any one of them is dropped,then the package will be consequently marked as invalid.
When Someone executes the package then DB2 will perform an automatic rebind and if the object is still not available then that package is marked as inoperative and no further automatic rebinds are performed for the same and the execution will fail.
A BIND permits us to use new BIND parameters but the REBIND uses the already specified parameters.
Further if you want to specify new parameters for the execution of your Package and if the whole SQL has been changed (like referencing to new objects) then a BIND is required .
And if you simply want to redo the evaluation of the access path for the package then being cost efficient and optimized,the REBIND is the best option.
Cheers!!
Please verify your statemnt - "A BIND permits us to use new BIND parameters but the REBIND uses the already specified parameters."
ReplyDeleteI do believe you can override or change most parameters to a new value on a rebind as well.