ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux下为DB2 9.7打补丁

Linux下为DB2 9.7打补丁

Linux操作系统 作者:like052629 时间:2015-08-21 13:50:23 0 删除 编辑

一、查看当前数据库版本

[db2inst@localhost ~]$ db2level

DB21085I  Instance "db2inst" uses "32" bits and DB2 code release "SQL09075"

with level identifier "08060107".

Informational tokens are "DB2 v9.7.0.5", "s111017", "IP23291", and Fix Pack

"5".

Product is installed at "/opt/ibm/db2/V9.7".

 

当前补丁包版本为5,更新至最新补丁包pack 7

 

二、下载并解压补丁包

注意,补丁包下载并解压缩至的目录路径中不能包含任何空格。如果该目录路径中包含空格,那么安装将失败。

[root@localhost db2pack]# tar -xvf v9.7fp7_linuxia32_server.tar.gz

 

三、停止所有DB2进程

1、停止实例

[root@localhost db2pack]# su - db2inst

[db2inst@localhost ~]$ db2 force applications all               --断开所有应用程序

DB20000I  The FORCE APPLICATION command completed successfully.

DB21024I  This command is asynchronous and may not be effective immediately.

 

[db2inst@localhost ~]$ db2 terminate             --断开当前与数据库连接并关闭后台进程

DB20000I  The TERMINATE command completed successfully.

[db2inst@localhost ~]$ db2stop                      --停止实例

2012-12-04 00:24:23     0   0   SQL1064N  DB2STOP processing was successful.

SQL1064N  DB2STOP processing was successful.

[db2inst@localhost bin]$ db2licd –end      --在每一个物理分区执行

 

2、如果DB2管理服务器(DAS)属于要更新的DB2副本,则停止DAS

[db2inst@localhost ~]$ su - dasusr

密码:

[dasusr@localhost ~]$ db2admin stop   --停止DAS

SQL4410W  The DB2 Administration Server is not active.

 

3、可选:在AIX上,在安装前运行slibclean以从内存中卸载未使用的共享库:

/usr/sbin/slibclean

 

4、禁用故障监视器进程。

DB2DIR/bin/db2fm –I iname -D

[db2inst@localhost bin]$ db2fm -i db2inst –D        --停止故障监视器进程守护程序

必须对DB2副本中的每个实例执行一次。

 

5、如果启动了故障监视器协调程序(FMC),要阻止实例自动启动:

 

[db2inst@localhost bin]$ db2fmcu      --确定是否启动了故障监视器协调程序(FMC

Warning: db2fmcu not running as root.

FMC: down

这里FMC没有启动,如果启动,则输出内容类似于:FMC: up: PID = 3415

 

 

如果启动了FMC确定是否有实例被配置为在系统每次重新启动就自动启动

DB2DIR/instance/db2iset –I iname –all

[root@localhost instance]# /opt/ibm/db2/V9.7/instance/db2iset

DB2COMM=tcpip

DB2AUTOSTART=YES

 

阻止实例自动启动db2iauto –off iname

[root@localhost instance]# db2iauto -off db2inst

 

6、确保对要更新的实例清除了所有DB2进程间通信。

[db2inst@localhost /]$ ipclean         --清除要更新的实例所有DB2进程间通信,在每个物理分区中执行

ipclean: Removing DB2 engine and client's IPC resources for db2inst.

 

四、安装补丁包

有两种方法安装补丁包:

一种是安装新的DB2数据库产品,使用db2setup命令安装处于特定补丁包级别的新DB2数据库产品。相当于安装DB2

另一种是更新现有的DB2数据库产品,即通常所说的打补丁。使用installFixPack命令。

这里用第二种。

 

[root@localhost server]# ./installFixPack -b /opt/ibm/db2/V9.7

 

 

五、安装后任务

[root@localhost server]# db2level

DB21085I  This instance or install (instance name, where applicable: "db2inst")

uses "32" bits and DB2 code release "SQL09077" with level identifier

"08080107".

Informational tokens are "DB2 v9.7.0.7", "s121002", "IP23373", and Fix Pack

"7".

Product is installed at "/opt/ibm/db2/V9.7".

 

1、更新实例以使用新的DB2级别。

安装补丁包后,必须更新该DB2副本中的所有现有实例。缺省情况下,installFixPack命令将自动更新DB2实例。但是,如果发生错误,可以手动更新

1)、作为root用户登录。

2)、通过发出以下命令确定与DB2副本相关联的实例:

[root@localhost instance]# db2ilist

db2inst

3)、如果对db2profiledb2cshrc脚本进行了任何更改,备份这些脚本或者将更改分别复制到userprofileusercshrc脚本中。由于db2iupdt命令覆盖db2profiledb2cshrc脚本,因此此操作是必须的。它不覆盖userprofileusercshrc脚本。

4)、对每个实例发出以下命令:

DB2DIR/instance/db2iupdt iname

Iname表示实例名称,DB2DIR表示安装了DB2副本的位置。

 

[root@localhost instance]# /opt/ibm/db2/V9.7/instance/db2iupdt db2inst

DBI1070I  Program db2iupdt completed successfully.

 

db2iupdt 命令的作用:

FUNCTION: db2iupdt - update a DB2 instance after installation/removal

- of a new DB2 release (of the same version)

                      - of additional DB2 products

                       (eg. updating a client to a server)

-          of a patch/PTF

5)、如果DAS属于安装了修订包的DB2副本,要发出以下命令:

DB2DIR/instance/dasupdt

 

[root@localhost instance]# /opt/ibm/db2/V9.7/instance/dasupdt

SQL4410W  The DB2 Administration Server is not active.

SQL4406W  The DB2 Administration Server was started successfully.

DBI1070I  Program dasupdt completed successfully.

 

2可选:更新数据库中的系统目录对象以支持修订包。如果希望使用特定于修订包的功能,则强烈建议执行此任务。如果安装了修订包来创建新的安装,那么不必执行此任务,因为目前没有数据库。

对于应用了修订包的DB2副本中的每个实例,执行下列操作:

1)、作为实例所有者登录。

2)、对每个数据库发出以下命令:db2updv97 –d dbname

 

[db2inst@localhost ~]$ db2updv97 -d sampl

 

 

_________________________________________________________________________    

                                                                             

                    _____   DB2 Service Tools   _____                         

                                                                             

                            I      B      M                                  

                                                                             

                               db2updv97                                     

                                                                             

   This tool is a service utility designed to update a DB2 Version 9.7       

   database to the current fixpak level.                                     

                                                                             

_________________________________________________________________________    

 

 

DB2 Universal Database Version 9.7, 5622-044 (c) Copyright IBM Corp. 2009

Licensed Material - Program Property of IBM

IBM DATABASE 2 Database update to current fix pack tool

 

db2updv97 completed successfully for database 'sampl'.

 

[db2inst@localhost ~]$ db2updv97 -d test

 

 

_________________________________________________________________________    

                                                                             

                    _____   DB2 Service Tools   _____                        

                                                                              

                            I      B      M                                  

                                                                             

                               db2updv97                                      

                                                                             

   This tool is a service utility designed to update a DB2 Version 9.7       

   database to the current fixpak level.                                     

                                                                              

_________________________________________________________________________    

 

 

DB2 Universal Database Version 9.7, 5622-044 (c) Copyright IBM Corp. 2009

Licensed Material - Program Property of IBM

IBM DATABASE 2 Database update to current fix pack tool

 

db2updv97 completed successfully for database 'test'.

 

3、重新启动实例和DAS

如果安装修订包来更新现有安装,那么此步骤是必需的。如果安装了修订包来创建新安装,那么此步骤不是必需的。

[db2inst@localhost ~]$ db2start         --对于每个实例!

12/04/2012 17:48:17     0   0   SQL1063N  DB2START processing was successful.

SQL1063N  DB2START processing was successful.

 

[db2inst@localhost ~]$ su - dasusr

密码:

[dasusr@localhost ~]$ db2admin start

SQL4409W  The DB2 Administration Server is already active.

 

4可选。如果在安装修订包之前发出了db2iauto命令以阻止实例自动启动,对这些实例启用自动启动。

[db2inst@localhost ~]$ db2iauto -on db2inst

 

5、对绑定文件进行绑定

在为服务器安装修订包过程中,将自动绑定数据库应用程序(IMPORTEXPORTREORG和命令行处理器)和CLI绑定文件。但是,如果在客户机上安装修订包或发生错误,那么可以手动绑定数据库实用程序和CLI绑定文件。

1)、如果在具有现成数据库的DB2数据库产品基础上安装修订包,对每个数据库执行一次下列命令:

db2 terminate

db2 CONNECT TO dbname user USERID using PASSWORD

db2 BIND path/db2schema.bnd BLOCKING ALL GRANT PUBLIC SQLERROR CONTINUE

db2 BIND path/@db2ubind.lst BLOCKING ALL GRANT PUBLIC ACTION ADD

db2 BIND path/@db2cli.lst BLOCKING ALL GRANT PUBLIC ACTION ADD

db2 terminate

 

db2ubind.lstdb2cli.lst包含DB2数据库产品所使用的必须绑定文件列表。已绑定的程序包将返回SQL0719N错误。这是期望的行为。

[db2inst@localhost bnd]$ db2 bind db2schema.bnd blocking all grant public sqlerror continue

 

LINE    MESSAGES FOR db2schema.bnd

------  --------------------------------------------------------------------

        SQL0061W  The binder is in progress.

        SQL0091N  Binding was ended with "0" errors and "0" warnings.

[db2inst@localhost bnd]$ db2 bind @db2ubind.lst blocking all grant public action add

 

LINE    MESSAGES FOR db2ubind.lst

------  --------------------------------------------------------------------

        SQL0061W  The binder is in progress.

 

LINE    MESSAGES FOR db2ajgrt.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLABH02" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2ueiwi.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUAH19" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uigsi.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUCH05" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2ucktb.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUJH0A" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uiici.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUDH02" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uiict.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUEH01" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uexpm.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUBH05" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uimpm.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUFH13" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uImpInsUpdate.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUPH03" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uiDescribe.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUPH00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2ugtpi.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUHH03" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2pctsp.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLP1H02" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uredp.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUIH00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2clpcs.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLC2H23" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2clprr.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLC3H22" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2clpur.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLC4H22" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2clprs.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLC5H22" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2clpnc.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLC6H22" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2arxcs.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLA1H00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2arxrr.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLA2H00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2arxrs.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLA4H00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2arxnc.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLA5H00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2arxur.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLA3H00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2dropv.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLE3H01" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uimtb.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUKH08" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uqtpd.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUMH00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uqtnm.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLULH00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2ulxld.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUNH01" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uiXmlparse.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUZH00" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2uipkg.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.SQLUOH01" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2ats_sps.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.ATSH04" already exists.  SQLSTATE=42710

 

LINE    MESSAGES FOR db2_adminotm.bnd

------  --------------------------------------------------------------------

        SQL0719N  Bind error for user "DB2INST ". Package

                  "NULLID.AOTMH01" already exists.  SQLSTATE=42710

        SQL0082C  An error has occurred which has terminated

                  processing.

        SQL0092N  No package was created because of previous errors.

        SQL0091N  Binding was ended with "34" errors and "0"

                  warnings.

[db2inst@localhost bnd]$ db2 bind @db2cli.lst blcoking all grant public action add

SQL0104N  An unexpected token "blcoking" was found following "". 

Expected tokens may include:  "ACTION".  SQLSTATE=42601

[db2inst@localhost bnd]$ db2 bind @db2cli.lst blocking all grant public action add

 

LINE    MESSAGES FOR db2cli.lst

------  --------------------------------------------------------------------

        SQL0061W  The binder is in progress.

        SQL0091N  Binding was ended with "0" errors and "0" warnings.

 

2)、如果在具有现成数据库的DB2产品基础上安装修订包,要运行REBINDdb2rbind命令来重新绑定程序包

安装修订包后,某些程序包会被标记为无效。应用程序受此使用被标记为无效的程序包时,会隐式地重新绑定这些程序包。要消除此开销并确保重新绑定操作成功,要手动重新绑定所有程序包。

 [db2inst@localhost ~]$ db2rbind test -l logfile all

 

 Rebind done successfully for database 'TEST'.

 

--logfile是在程序包重新生效期间要用于记录错误的文件名。

 

3)、如果在具有支持空间的现有数据库的DB2数据库产品基础上安装修订包,要对每个数据库执行下列命令:

db2 terminate

db2 CONNECT TO dbname user USERID using PASSWORD

db2 BIND path/BND/@db2gse.lst

db2 terminate

 

4)、如果连接至主机或System i 服务器上的DB2数据库,要执行下列操作:

l     对于 z/OS® OS/390® 上的 DB2 数据库:

db2 terminate

db2 CONNECT TO dbname user USERIN using PASSWORD

db2 BIND path/@ddcsmvs.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD

db2 terminate

l     对于VM上的DB2数据库:

db2 terminate

db2 CONNECT TO dbname user USERID using PASSWORD

db2 BIND path/@ddcsvm.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD

db2 terminate

l     对于VSE上的DB2数据库:

db2 terminate

db2 CONNECT TO dbname user USERID using PASSWORD

db2 BIND path/@ddcsvse.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD

db2 terminate

l     对于System i 上的数据库:

db2 terminate

db2 CONNECT TO dbname user USERID using PASSWORD

db2 BIND path/@ddcs400.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD

db2 terminate

5)、如果连接至正在不同操作系统(LinuxUNIXWindows)或在不同DB2版本或服务级别运行的数据库,那么对这些数据库绑定数据库实用程序和CLI绑定文件。

db2 terminate

db2 CONNECT TO dbname user USERID using PASSWORD

db2 BIND path/@db2ubind.lst BLOCKING ALL GRANT PUBLIC ACTION ADD

db2 BIND path/@db2cli.lst BLOCKING ALL GRANT PUBLIC ACTION ADD

db2 terminate

 

db2ubind.lstdb2cli.lst包含DB2数据库产品所使用的必须绑定文件列表。已绑定的程序包将返回SQL0719错误。这是期望的行为。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28258625/viewspace-1778536/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-11-18

  • 博文量
    120
  • 访问量
    470535