db2 linux bind,DB2 package的bind、rebind和db2rbind

如下都是一些系统默认的绑定文件名称,其实都是DB2提供的实用程序包的绑定文件,这些文件当然也是采用了C等嵌入式语言开发的SP。但大部分我们的程序包都是用SQL语言开发的SP,所以这个时候一般都是用rebind

C:\Program Files (x86)\IBM\SQLLIB\bnd>ls

ASNDONE.bnd            asnmdata.bnd          asntdiff.bnd          db2advmisc.bnd        db2dropv.bnd          db2stats.bnd          ddcsvm.lst

ASNLOAD.bnd            asnmig4c.bnd          asntdiff.lst          db2advmqt.bnd          db2dsproc.bnd          db2uImpInsUpdate.bnd  ddcsvse.lst

altobj_sp.bnd          asnmig8.bnd            asntdsql.bnd          db2advsimulation.bnd  db2evmon.bnd          db2ubind.lst          gseClAdv.bnd

altobj_util.bnd        asnmoncs.lst          asnuow.bnd            db2advworkload.bnd    db2exdyn.bnd          db2ucktb.bnd          gseClIdx.bnd

applycs.lst            asnmonit.bnd          bhunt.bnd              db2ajgrt.bnd          db2exfmt.bnd          db2ueiwi.bnd          gseClSQL.bnd

applyur.lst            asnmonit.lst          cAdmCancelWork.bnd    db2am.bnd              db2exmig.bnd          db2uexpm.bnd          hleoFwMine.bnd

asnaapp.bnd            asnmonur.lst          cAdmGetConfig.bnd      db2arxcs.bnd          db2expln.bnd          db2ugtpi.bnd          hleoFwPop.bnd

asnacmp.bnd            asnmproc.bnd          cAdmGetMessage.bnd    db2arxnc.bnd          db2exsrv.bnd          db2uiDescribe.bnd      mdcadvise.bnd

asnadmin.bnd          asnmupdt.bnd          cAdmGetPlanHint.bnd    db2arxrr.bnd          db2gpmap.bnd          db2uiXmlparse.bnd      mqlConfig.bnd

asnadmsp.bnd          asnprune.bnd          cAdmGetSystemInfo.bnd  db2arxrs.bnd          db2lk390.bnd          db2uigsi.bnd          mqlRun.bnd

asnafet.bnd            asnqahkt.bnd          cAdmSetConfig.bnd      db2arxur.bnd          db2lkfun.bnd          db2uiici.bnd          partadvise.bnd

asnaiso.bnd            asnqapag.bnd          cAdmSetPlanHint.bnd    db2ats_sps.bnd        db2lkmig.bnd          db2uiict.bnd          psmgtptp.bnd

asnaman.bnd            asnqapp.bnd            capture.lst            db2cat.bnd            db2lksp.bnd            db2uimpm.bnd          qapply.lst

asnanalyze.bnd        asnqarow.bnd          db2ExplainRtns.bnd    db2cli.lst            db2look.bnd            db2uimtb.bnd          qcapture.lst

asnappwk.bnd          asnqasub.bnd          db2_adminotm.bnd      db2clipk.bnd          db2move.bnd            db2uipkg.bnd          redistrb.bnd

asnaprs.bnd            asnqbrwz.bnd          db2_aram.bnd          db2clist.bnd          db2pctsp.bnd          db2ulxld.bnd          reval.bnd

asnawpn.bnd            asnqload.bnd          db2admDbUtil.bnd      db2clpcs.bnd          db2policy.bnd          db2updv97.bnd          sgSql.bnd

asnccpwk.bnd          asnqmon.bnd            db2admcs.bnd          db2clpnc.bnd          db2rbind.bnd          db2uqtnm.bnd          snaputil.bnd

asncdins.bnd          asnqp2pa.bnd          db2advcatalog.bnd      db2clprr.bnd          db2sampl_SQL.bnd      db2uqtpd.bnd          st_admin.bnd

asncmon.bnd            asnqp2pi.bnd          db2advindex.bnd        db2clprs.bnd          db2sampl_V8.bnd        db2uredp.bnd          tbscont.bnd

asndb2cn.bnd          asnqspil.bnd          db2advio.bnd          db2clpsy.bnd          db2sampl_XML.bnd      db2xdbmig.bnd          xdb.lst

asndb2sq.bnd          asnreg.bnd            db2advis.bnd          db2clpur.bnd          db2schema.bnd          db2xdbsg.bnd          xdbSPImpl.bnd

asndbcon.bnd          asnsqlcd.bnd          db2advisSP.bnd        db2common.bnd          db2spcat.bnd          ddcs400.lst            xdbSPutil.bnd

asnluwcon.bnd          asntdapi.bnd          db2advmdc.bnd          db2dclgn.bnd          db2spcdb.bnd          ddcsmvs.lst            xdbTupleWriter.bnd

其实工作中我们最常用的还是rebind命令,db2 rebind package packagename,不过该pakagename是存储在数据库中的P打头的数字名称,无法使用直接创建的名称,所以rebind前需要获取这个名称。一般可以这样获取:

db2 "select ' db2 rebind package '||rtrim(r.routineschema)||'.'||'P'||substr(char(r.lib_id+10000000),2) from syscat.routines r where r.routinetype = 'P'"

但其实不是所有的SP都有lib_id的,所以貌似这个不能绑定像上面的嵌入式程序包。

最后再说db2rbind,这个其实最简单,可以选择只绑定无效的程序包或者整库绑定,因而无法指定对个别SP进行绑定,当然在数据库刚恢复或升级了,就需要重新bind,否则无法使用新的包,并且还得使用replace参数才能完全覆盖之前的包中的信息,为了保证性能,可以这样做,后期的维护中大部分都不需要整库进行绑定,当对表的统计信息进行更新,创建索引,或者reorg操作了,就的需要对依赖的SP做一个rebind,以便于更新package中存储的解释执行信息。

默认这三个工具绑定的效果都是一样的,不同的是,各自有各自的参数,尤其是rebind和bind,绑定参数的使用有的时候直接对性能有很大的提升。

还有,现在DB2提供了一些管理例程工具就像这个专门做SP的重新绑定操作,只需要指定SP例程的类型和名称,当然也可以指定像rebind等指定的参数可选项,就可以对SP进行绑定了,如下:

CALL SYSPROC.REBIND_ROUTINE_PACKAGE ('P','SODS0.DP_INSRT_RT_VALID_SALES_ORD','')

0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值