【IBM DB2 补丁升级安装】从DB2 v9.5.0.1升级到DB2 v9.5.0.6

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1750

【IBM DB2 补丁升级安装】从DB2 v9.5.0.1升级到DB2 v9.5.0.6

1、补丁下载地址:
大补丁下载:
[url]http://www-01.ibm.com/support/docview.wss?rs=71&uid=swg27007053
DB2 9.5 FP6 has been released as DB2 9.5 FP6a

小补丁下载:
[url]http://www-01.ibm.com/support/docview.wss?rs=71&uid=swg212935662、

2、安装修订包之前
1)获得修订包,地址如上。
2)解压缩修订包。

3、停止所有 DB2 进程
1)确定与 DB2 副本相关联的实例。 发出以下命令:
cd /opt/ibm/db2/V9.5/
DB2DIR/instance/db2ilist
[db2inst1@ibmdb2 db2]$ db2ilist
db2inst1
2)对 DB2 副本中的每个实例运行下列命令
su - db2inst1
. $HOME/sqllib/db2profile
db2 force applications all
db2 terminate
db2stop
db2licd -end # run at each physical partition
exit
[db2inst1@ibmdb2 db2]$ db2 force application all
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
[db2inst1@ibmdb2 db2]$ db2 terminate
DB20000I The TERMINATE command completed successfully.

[db2inst1@ibmdb2 db2]$ db2stop
10/17/2010 21:06:46 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
[db2inst1@ibmdb2 db2]$ db2licd -end

3)如果 DB2 管理服务器(DAS)属于要更新的 DB2 副本,请停止 DAS
su - dasusr1
. $HOME/das/dasprofile
db2admin stop
exit
[dasusr1@ibmdb2 ~]$ db2admin stop
SQL4407W The DB2 Administration Server was stopped successfully.

4)安装前应运行 slibclean 来从内存中卸装未使用的共享库:
/usr/sbin/slibclean
//以下为参考:
ipcs -m| grep db2 | awk '{print $2}'|xargs -i ipcrm -m {}
ipcs -s| grep db2| awk '{print $2}'|xargs -i ipcrm -s {}

5)禁用故障监视器进程。 要停止故障监视器守护程序,请发出以下命令:
/opt/ibm/db2/V9.5/bin/db2fm -i db2inst1 -D
/opt/ibm/db2/V9.5/bin/db2fm return non-zero rc, please see log file '/home/db2inst1/sqllib/db2dump/db2diag.log'

6)如果启用了故障监视器协调程序(FMC),那么请阻止您的实例自动启动:
a. 要确定是否启用了 FMC,请发出以下命令:
/opt/ibm/db2/V9.5/bin/db2fmcu
[db2inst1@ibmdb2 db2]$ /opt/ibm/db2/V9.5/bin/db2fmcu
FMC: down
其中 DB2DIR 是安装了 DB2 副本的位置。 如果启用了 FMC,那么您将看到类似于以下内容的输出:FMC: up: PID = 3415。如果禁用了 FMC,那么 db2fmcu 命令的输出将是:FMC: down。
b. 如果启用了 FMC,请确定是否有实例配置为在每次系统重新启动之后自动启动。 发出以下命令:
/opt/ibm/db2/V9.5/instance/db2iset -i db2inst1 -all
[ibmdb2]/root #/opt/ibm/db2/V9.5/instance/db2iset -i db2inst1 -all
[i] DB2COMM=TCPIP
[i] DB2AUTOSTART=YES
[g] DB2SYSTEM=ibmdb2
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=dasusr1
如果 db2set 命令的输出包含以下内容,那么这表示该实例已配置为自动启动:DB2AUTOSTART=YES

c. 阻止这些实例自动启动。 发出以下命令:
/opt/ibm/db2/V9.5/instance/db2iauto -off db2inst1
[ibmdb2]/root #/opt/ibm/db2/V9.5/instance/db2iauto -off db2inst1
[ibmdb2]/root #/opt/ibm/db2/V9.5/instance/db2iset -i db2inst1 -all
[i] DB2COMM=TCPIP
[g] DB2SYSTEM=ibmdb2
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=dasusr1
如果有需要,请在完成修订包安装之后重新启用实例自动启动:
/opt/ibm/db2/V9.5/instance/db2iauto -on db2inst1
7)确保对要更新的实例清除了所有 DB2 进程间通信。作为实例所有者,在每个物理分区中运行以下命令:
$HOME/sqllib/bin/ipclean
[db2inst1@ibmdb2 db2]$ $HOME/sqllib/bin/ipclean
/home/db2inst1/sqllib/bin/ipclean: Removing DB2 engine and client's IPC resources for db2inst1.

3、安装补丁包
1. 对于 root 用户安装,请以 root 用户身份登录。对于非 root 用户安装,请使用拥有非 root 用户安装的用户标识来登录。

2. 切换至包含修订包映像的目录。
[db2inst1@ibmdb2 server]# cd /soft/db2/server
[db2inst1@ibmdb2 server]# pwd
/soft/db2/server
3. 通过发出 installFixPack 命令来启动安装。 例如,
./installFixPack -b /opt/ibm/db2/V9.5 (报错)

[ibmdb2]/soft/db2/server #./installFixPack -b /opt/ibm/db2/V9.5
DBI1017I installFixPack is updating the DB2 product(s) installed in
location /opt/ibm/db2/V9.5.

DB2 installation is being initialized.
Total number of tasks to be performed: 36
Total estimated time for all tasks to be performed: 1175
Task #1 start
Description: Stopping DB2 Fault Monitor
Estimated time 10 second(s)
Task #1 end
Task #2 start
Description: Preparing the system
Estimated time 120 second(s)
A major error occurred during the execution that caused this program to
terminate prematurely. If the problem persists, contact your technical service
representative.
For more information see the DB2 installation log at
"/tmp/installFixPack.log.27966".
[ibmdb2]/soft/db2/server #more /tmp/installFixPack.log.27966
DB2 Fix Pack Update log file started at: Sun Oct 17 21:25:30 2010 CST
============================================================
Operating system information: Linux 2.6.18-194.el5.#1 SMP Mon Mar 29 20:06:41 EDT 2010 i686
Previously Installed Components:
Base client support
Java support
SQL procedures
Base server support
IBM Software Development Kit (SDK) for Java(TM)
Connect support
Communication support - TCP/IP
Replication tools
Control Center
DB2 data source support
DB2 LDAP support
DB2 Instance Setup wizard
First Steps
Sample database source
Selected Components:
Base client support
Java support
SQL procedures
Base server support
IBM Software Development Kit (SDK) for Java(TM)
Connect support
Communication support - TCP/IP
Replication tools
Control Center
DB2 data source support
DB2 LDAP support
DB2 Instance Setup wizard
First Steps
Sample database source

Languages:
English (already installed )

Target directory: /opt/ibm/db2/V9.5

Space required: 500 MB

Stopping DB2 Fault Monitor :.......Success
ERROR: The installFixPack command detected some DB2 libraries are still loaded
in memory and some applications might still be running in the current
installation copy. All applications must be stopped. See the fix pack readme
for pre-installation instructions, and re-run the installFixPack command.
Alternatively, to override automatic checking, you can re-issue the
installFixPack command with the '-f db2lib' parameter. Note: If you re-issue
the installFixPack command with the '-f db2lib' parameter, after the DB2
instances are updated, some applications might not work properly and might need
to be restarted to function properly against the updated DB2 instance.
Preparing the system :.......Failure
DB2 Fix Pack Update log file finished at: Sun 17 Oct 2010 09:26:03 PM CST CST
============================================================
根据以上报错,重新增加-f db2lib, 参数如下:
[ibmdb2]/soft/db2/server #./installFixPack -b /opt/ibm/db2/V9.5 -f db2lib
参数说明:
-f db2lib
Force installFixPack to bypass the checking on DB2 library loading. To ensure that the instances or applications work properly after the installation, the DBM must be stopped for all the related instances (including all nodes for the related DPF instances), and all DB2 libraries related to the installation path must be unloaded.
DBI1017I installFixPack is updating the DB2 product(s) installed in
location /opt/ibm/db2/V9.5.

DB2 installation is being initialized.
Total number of tasks to be performed: 36
Total estimated time for all tasks to be performed: 1175
Task #1 start
Description: Stopping DB2 Fault Monitor
Estimated time 10 second(s)
Task #1 end
Task #2 start
Description: Preparing the system
Estimated time 120 second(s)
Task #2 end
Task #3 start
Description: Base Client Support for installation with root privileges
Estimated time 3 second(s)
Task #3 end
Task #4 start
Description: Product Messages - English
Estimated time 11 second(s)
Task #4 end
Task #5 start
Description: Base client support
Estimated time 85 second(s)
Task #5 end
Task #6 start
Description: The DB2 required component.
Estimated time 77 second(s)
Task #6 end
Task #7 start
Description: Java Help (HTML) - English
Estimated time 7 second(s)
Task #7 end
Task #8 start
Description: Base server support for installation with root privileges
Estimated time 7 second(s)
Task #8 end
Task #9 start
Description: Global Secure ToolKit
Estimated time 14 second(s)
Task #9 end
Task #10 start
Description: Java support
Estimated time 11 second(s)
Task #10 end
Task #11 start
Description: SQL procedures
Estimated time 3 second(s)
Task #11 end
Task #12 start
Description: ICU Utilities
Estimated time 54 second(s)
Task #12 end
Task #13 start
Description: Java Common files
Estimated time 22 second(s)
Task #13 end
Task #14 start
Description: Base server support
Estimated time 195 second(s)
Task #14 end
Task #15 start
Description: IBM Software Development Kit (SDK) for Java(TM)
Estimated time 32 second(s)
Task #15 end
Task #16 start
Description: Control Center Help (HTML) - English
Estimated time 13 second(s)
Task #16 end
Task #17 start
Description: Connect support
Estimated time 3 second(s)
Task #17 end
Task #18 start
Description: Communication support - TCP/IP
Estimated time 3 second(s)
Task #18 end
Task #19 start
Description: Parallel Extension
Estimated time 3 second(s)
Task #19 end
Task #20 start
Description: Replication tools
Estimated time 18 second(s)
Task #20 end
Task #21 start
Description: Control Center
Estimated time 50 second(s)
Task #21 end
Task #22 start
Description: DB2 data source support
Estimated time 4 second(s)
Task #22 end
Task #23 start
Description: DB2 LDAP support
Estimated time 3 second(s)
Task #23 end
Task #24 start
Description: DB2 Instance Setup wizard
Estimated time 4 second(s)
Task #24 end
Task #25 start
Description: First Steps
Estimated time 3 second(s)
Task #25 end
Task #26 start
Description: Product Signature for DB2 Enterprise Server Edition
Estimated time 5 second(s)
Task #26 end
Task #27 start
Description: Sample database source
Estimated time 4 second(s)
Task #27 end
Task #28 start
Description: Installing or updating SA MP Base Component
Estimated time 40 second(s)
Task #28 end
Task #29 start
Description: Installing or updating DB2 HA scripts for SA MP Base Component
Estimated time 40 second(s)
Task #29 end
Task #30 start
Description: Setting DB2 library path
Estimated time 180 second(s)
Task #30 end
Task #31 start
Description: Executing control tasks
Estimated time 20 second(s)
Task #31 end
Task #32 start
Description: Updating global registry
Estimated time 20 second(s)
Task #32 end
Task #33 start
Description: Starting DB2 Fault Monitor
Estimated time 10 second(s)
Task #33 end
Task #34 start
Description: Updating the db2ls link
Estimated time 1 second(s)
Task #34 end
Task #35 start
Description: Updating the DB2 Administration Server
Estimated time 40 second(s)
Task #35 end
Task #36 start
Description: Updating existing DB2 instances
Estimated time 60 second(s)
Task #36 end
The execution completed successfully.
For more information see the DB2 installation log at
"/tmp/installFixPack.log.32761".

客户端:
[ibmdb2]/soft/db2/client_conpe_t #./installFixPack -b /opt/ibm/db2/V9.5 -f db2lib

4、修订包的安装后任务
1)更新实例以使用新的 DB2 级别。
在安装修订包后,必须更新该 DB2 副本中的所有现有实例。缺省情况下,installFixPack 命令将自动更新 DB2 实例。但是,如果发生错误,那么可以手动更新实例。
执行下列步骤:
a. 以 root 用户身份登录。
b. 通过发出以下命令来确定与 DB2 副本相关联的实例:
/opt/ibm/db2/V9.5/instance/db2ilist
[db2inst1@ibmdb2 ~]$ /opt/ibm/db2/V9.5/instance/db2ilist
db2inst1
c. 如果对 db2profile 或 db2cshrc 脚本进行了任何更改,请备份这些脚本或者将更改分别复制到 userprofile 和 usercshrc 脚本中。
由于 db2iupdt 命令覆盖 db2profile 和 db2cshrc 脚本,因此此操作是必需的。它不覆盖 userprofile 和 usercshrc 脚本。
d. 对每个实例发出以下命令:
/opt/ibm/db2/V9.5/instance/db2iupdt db2inst1
[ibmdb2]/root #/opt/ibm/db2/V9.5/instance/db2iupdt db2inst1
DBI1070I Program db2iupdt completed successfully.
其中 iname 表示实例名称,而 DB2DIR 表示安装了 DB2 副本的位置。
e. 如果 DB2 管理服务器(DAS)属于安装了修订包的 DB2 副本,那么发出以下命令:

/opt/ibm/db2/V9.5/instance/dasupdt

[ibmdb2]/root #/opt/ibm/db2/V9.5/instance/dasupdt
SQL4410W The DB2 Administration Server is not active.
SQL4406W The DB2 Administration Server was started successfully.
DBI1070I Program dasupdt completed successfully.

其中 DB2DIR 是安装了 DB2 副本的位置。如果此 DB2 副本现在正在比所有其他 DB2 副本更新的修订包级别运行,请考虑更新该 DAS 以属于此 DB2 副本。

2). 可选:更新数据库中的系统目录对象以支持修订包。
如果要使用特定于修订包的功能,那么强烈建议您执行此任务。如果由于没有现成的数据库而安装了修订包来创建新的安装,那么此任务不是必需的。
对于已应用修订包的 DB2 副本中的每个实例,请执行下列操作:
a. 以实例所有者身份登录。
b. 对每个数据库发出以下命令:
db2updv95 -d toolsdb
db2updv95 -d test1
db2updv95 -d systools
其中 dbname 表示数据库名称。
日志如下:

[db2inst1@ibmdb2 ~]$ db2updv95 -d toolsdb

_________________________________________________________________________

_____ DB2 Service Tools _____

I B M

db2updv95

This tool is a service utility designed to update a DB2 Version 9.5
database to the current fixpak level.

_________________________________________________________________________

DB2 Universal Database Version 9.5, 5622-044 (c) Copyright IBM Corp. 2007
Licensed Material - Program Property of IBM
IBM DATABASE 2 Database update to current fix pack tool
db2updv95 completed successfully for database 'toolsdb'.
[db2inst1@ibmdb2 ~]$ db2updv95 -d test1

_________________________________________________________________________

_____ DB2 Service Tools _____

I B M

db2updv95

This tool is a service utility designed to update a DB2 Version 9.5
database to the current fixpak level.

_________________________________________________________________________

DB2 Universal Database Version 9.5, 5622-044 (c) Copyright IBM Corp. 2007
Licensed Material - Program Property of IBM
IBM DATABASE 2 Database update to current fix pack tool
db2updv95 completed successfully for database 'test1'.

[db2inst1@ibmdb2 ~]$ db2updv95 -d systools

_________________________________________________________________________

_____ DB2 Service Tools _____

I B M

db2updv95

This tool is a service utility designed to update a DB2 Version 9.5
database to the current fixpak level.

_________________________________________________________________________

DB2 Universal Database Version 9.5, 5622-044 (c) Copyright IBM Corp. 2007
Licensed Material - Program Property of IBM
IBM DATABASE 2 Database update to current fix pack tool
db2updv95 completed successfully for database 'systools'.

3) 重新启动实例和 DAS。
如果安装了修订包来更新现有安装,那么此步骤是必需的。如果安装了修订包来创建新安装,那么此步骤不是必需的。
要重新启动实例,请执行以下操作:
a. 以实例所有者身份登录。
b. 发出命令 db2start。
[ibmdb2]/root #su - db2inst1
[db2inst1@ibmdb2 ~]$ db2start
10/18/2010 00:44:54 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful
对于每个实例重复这些步骤

要重新启动 DB2 管理服务器,请以 DAS 所有者身份登录并运行
db2admin start
[ibmdb2]/root #su - dasusr1
[dasusr1@ibmdb2 ~]$ db2admin start
SQL4409W The DB2 Administration Server is already active.

4) 可选:如果您发出了 db2iauto 命令以在安装修订包之前阻止实例自动启动,那么请再次对这些实例启用自动启动。 以 root 用户身份登录时发出下列命令:
/opt/ibm/db2/V9.5/instance/db2iauto -on db2inst1
其中 DB2DIR 是安装了 DB2 副本的位置,而 iname 则表示实例所有者名称。必须对您在安装修订包之前使用 db2iauto 命令改变的每个实例执行一次此命令。

5). 可选:对绑定文件进行绑定。 将自动绑定数据库实用程序和 DB2 CLI 绑定文件。但是,如果发生错误,那么可以手动绑定数据库实用程序和 DB2 CLI 绑定文件。请参阅安装修订包后对绑定文件进行绑定。

6). 可选:重新编译应用程序。
要利用对应用程序中链接至的文件所作的任何更改,建议您重新编译应用程序。

查看版本:
[db2inst1@ibmdb2 ~]$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.5.6
[db2inst1@ibmdb2 ~]$ db2level -a
DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL09056"
with level identifier "06070107".
Informational tokens are "DB2 v9.5.0.6", "s100918", "IP23208", and Fix Pack
"6a".
Product is installed at "/opt/ibm/db2/V9.5".
5、卸载修订包
对于 Linux? 和 UNIX? 操作系统,通过重新安装较早级别的修订包可以返回到较早的修订包级别。在 Windows? 操作系统上,在应用修订包之后,您将无法返回到先前修订包,除非您卸载当前修订包,然后再安装先前修订包,方可返回到先前修订包级别。
1). 在 Linux 或 UNIX 操作系统上,要卸载修订包,请使用带有强制选项(-f)的 installFixPack 命令绕过级别检查。必须从较低级别修订包映像运行该命令。 例如:
./installFixPack -f level -b DB2DIR
其中
o DB2DIR 是要强制为较低级别的修订包映像的 DB2? 产品的位置。例如:

./installFixPack -f level -b /opt/ibm/db2/V9.5
2). 要在 Windows 操作系统上卸载修订包,请使用可通过 Windows 控制面板访问的“添加或删除程序”窗口。有关从 Windows 操作系统中除去软件产品的更多信息,请参阅操作系统的帮助。

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】