之前我都是reorg之后做runstats的,后来看了您的ppt之后发现要做rebind,请问为什么以及怎么做呢?
以前做个db2 bind xxx.lst,重新编译,类似吗?
reorg,runstats之后catalog table中存储的统计信息发生变更,对于dynamic SQL执行计划都是动态生成的,只用static SQL才需要rebind。因为static SQL的执行计划是在rebind时生成。语法为 db2 rebind package schema.packagename
收起还可以使用db2rbind <database> -l /tmp/db2rbind.log all 来绑定所有的package
注意:结尾是否加关键字<all>的区别如下
all
Specifies that rebinding of all valid and invalid packages is to be done. If this option is not specified, all packages in the database are examined, but only those packages that are marked as invalid are rebound, so that they are not rebound implicitly during application execution.