Oracle 11.2.0.4单机和rac集群打最新的PSU补丁
最新的PSU补丁如下:
注意:GI PSU补丁包里已经包含了PSU,即31718723的补丁包里已经包含了31537677,所以,下载只需要下载31718723即可。
1 2 | ./obsutil cp -r obs://oracle/11.2.0.4/p31718723_112040_Linux-x86-64.zip /soft/ ./obsutil cp -r obs://oracle/11.2.0.4/p6880880_112000_Linux-x86-64.zip /soft/ |
最新的OPATCH工具下载地址:https://updates.oracle.com/download/6880880.html ,需要注意大版本的匹配。
单机DB环境
单机的DB环境直接打31537677的PSU即可。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | su - oracle $ORACLE_HOME/OPatch/opatch version unzip /soft/p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME unzip /soft/p31718723_112040_Linux-x86-64.zip -d /soft/ cd /soft/31718723/31537677 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./ shutdown immediate $ORACLE_HOME/OPatch/opatch apply $ORACLE_HOME/OPatch/opatch lspatches chown oracle.oinstall /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/extjobO @?/rdbms/admin/catbundle.sql psu apply @?/rdbms/admin/utlrp.sql select * from DBA_REGISTRY_HISTORY d; |
rac环境
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | -- 以下命令在每个节点都需要执行: su - grid unzip /soft/p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME su - oracle unzip /soft/p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME su - grid $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME su - grid unzip /soft/p31718723_112040_Linux-x86-64.zip -d /soft/ su - root /u01/app/11.2.0.4/grid/OPatch/opatch auto /soft/31718723 ##### 上述补丁打完之后再执行如下的db操作 -- 查询 su - grid $ORACLE_HOME/OPatch/opatch lspatches su - oracle $ORACLE_HOME/OPatch/opatch lspatches -- DB @?/rdbms/admin/catbundle.sql psu apply @?/rdbms/admin/utlrp.sql select * from DBA_REGISTRY_HISTORY d; |
从日志可以看出,rac自动打补丁的大致过程为:
1、在节点1手动执行“/u01/app/11.2.0/grid/OPatch/opatch auto /soft/31718723”
2、自动关闭节点1的db实例,并打补丁
3、自动关闭节点1的crs,并打补丁
4、自动启动节点1的crs
5、自动启动节点1的db实例
6、在节点2手动执行“/u01/app/11.2.0/grid/OPatch/opatch auto /soft/31718723”,
7、自动关闭节点2的db实例,并打补丁
8、自动关闭节点2的crs,并打补丁
9、自动启动节点2的crs
10、自动启动节点2的db实例
注意:
1、每个节点大概15分钟,2个节点需要30分钟。
2、可以看出,现在打补丁为滚动打补丁,可以达到不停机的场景,挺好的。
日志:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | [root@rac1 ~]# /u01/app/11.2.0/grid/OPatch/opatch auto /soft/31718723 Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /soft -patchn 31718723 -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2021-11-24_16-48-59.log This file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2021-11-24_16-48-59.report.log 2021-11-24 16:48:59: Starting Clusterware Patch Setup Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params Stopping RAC /u01/app/oracle/product/11.2.0/dbhome_1 ... Stopped RAC /u01/app/oracle/product/11.2.0/dbhome_1 successfully patch /soft/31718723/29938455/custom/server/29938455 apply successful for home /u01/app/oracle/product/11.2.0/dbhome_1 patch /soft/31718723/31537677 apply successful for home /u01/app/oracle/product/11.2.0/dbhome_1 Stopping CRS... Stopped CRS successfully patch /soft/31718723/29938455 apply successful for home /u01/app/11.2.0/grid patch /soft/31718723/31537677 apply successful for home /u01/app/11.2.0/grid patch /soft/31718723/29509309 apply successful for home /u01/app/11.2.0/grid Starting CRS... Installing Trace File Analyzer CRS-4123: Oracle High Availability Services has been started. Starting RAC /u01/app/oracle/product/11.2.0/dbhome_1 ... Started RAC /u01/app/oracle/product/11.2.0/dbhome_1 successfully opatch auto succeeded. |
结果:
1 2 3 4 5 6 7 8 9 10 11 | [grid@rac2 ~]$ $ORACLE_HOME/OPatch/opatch lspatches 29509309;ACFS Patch Set Update : 11.2.0.4.190716 (29509309) 31537677;Database Patch Set Update : 11.2.0.4.201020 (31537677) 29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455) OPatch succeeded. [oracle@cwrac2 31537677]$ $ORACLE_HOME/OPatch/opatch lspatches 31537677;Database Patch Set Update : 11.2.0.4.201020 (31537677) OPatch succeeded. |
注意:若打补丁成功,但是启动的过程中不能启动,一直卡在ohasd进程这里,则需要关闭之前手工创建的服务,如下:
1 | systemctl disable ohas.service |
报错
crs不能启动
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | [root@cwrac2 soft]# /u01/app/11.2.0.4/grid/OPatch/opatch auto /soft/31718723 Executing /u01/app/11.2.0.4/grid/perl/bin/perl /u01/app/11.2.0.4/grid/OPatch/crs/patch11203.pl -patchdir /soft -patchn 31718723 -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params This is the main log file: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2022-08-05_16-14-16.log This file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2022-08-05_16-14-16.report.log 2022-08-05 16:14:16: Starting Clusterware Patch Setup Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params Stopping CRS... Stopped CRS successfully patch /soft/31718723/29938455 apply successful for home /u01/app/11.2.0.4/grid patch /soft/31718723/31537677 apply successful for home /u01/app/11.2.0.4/grid patch /soft/31718723/29509309 apply successful for home /u01/app/11.2.0.4/grid Starting CRS... Installing Trace File Analyzer CRS-4124: Oracle High Availability Services startup failed. CRS-4000: Command Start failed, or completed with errors. Oracle Grid Infrastructure stack start initiated but failed to complete at /soft/31718723/29938455/files/crs/install/crsconfig_lib.pm line 11821. |
这种情况下,grid的补丁已经打完了,但是db的补丁没有打,所以,还需要单独打db的补丁,可以参考本文的“单机DB环境”。
/usr/bin/ld: warning: -z lazyload ignored.
RDBMS 11.2.0.4.在安装PSU的时候,提示‘/usr/bin/ld: warning: -z lazyload ignored ’。通过查看MOS,该错误可以忽略。
OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
/usr/bin/ld: warning: -z lazyload ignored.
/usr/bin/ld: warning: -z nolazyload ignored.
参考文档:
"warning: -z lazyload ignored" and "warning: -z nolazyload ignored" During Install or Patching in 11.2.0.4 Database in OEL7/RHEL7 (Doc ID 2071922.1)