Oracle_RAC数据库GI的PSU升级(11.2.0.4.0到11.2.0.4.8)

2025-03-19Linux/AIX / Oracle / RAC

本次演示为升级Oracle rac数据库,用GI的psu升级,从11.2.0.4.0升级到11.2.0.4.8。

演示环境:

两个节点:rac1、rac2

GI的PSU升级包(11.2.0.4.8):p21352635_112040_Linux-x86-64.zip

解压缩后的目录:/setup/oracleUp/21523375

oracle 的$ORACLE_HOME:/u01/app/oracle/product/11.2.0/db_1

一:升级OPatch

下载最新的opatch程序并替换GI_HOME和ORACLE_HOME下的OPatch目录

注意:rac1和rac2两个节点的grid和oracle都要升级OPatch版本

到OPatch目录下:

view plain copy

  1. [oracle@rac1 db_1] $ pwd
  2. 2.

  3. /u01/app/oracle/product/11.2.0/db_1

备份之前的OPatch目录:

view plain copy

  1. [oracle@rac1 db_1] $ mv OPatch/ OPatch_20151116/

解压缩下载的最新的OPatch版本:

view plain copy

  1. [oracle@rac1 db_1]$ unzip p6880880_112000_Linux-x86-64.zip

查看opatch版本,已升级到最新的11.2.0.3.12版本 view plain copy

  1. [oracle@rac1 db_1] $ cd OPatch/
  2. 2.

  3. [oracle@rac1 OPatch] $ ./opatch version
  4. OPatch Version: 11.2.0.3.12OPatch succeeded.

二:生成ocm文件

在rac1和rac2分别生成ocm.rsp文件。

view plain copy

  1. [oracle@rac1 psu]$ pwd
  2. /u01/app/oracle/psu
  3. 3.

  4. [oracle@rac1 psu]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/bin/emocmrsp
  5. 5.

  6. [oracle@rac1 psu]$ ls
  7. ocm.rsp

三:给GRID_HOME安装补丁

1、rac1:

root用户执行

view plain copy

  1. [root@rac1 ~]# /u01/app/11.2.0/grid/OPatch/opatch auto /setup/oracleUp/21523375 -oh /u01/app/11.2.0/grid/ -ocmrf /u01/app/oracle/psu/ocm.rsp
  2. 2. 3. 4.

  3. Executing /u01/app/11.2.0/grid/perl/bin/perl/u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /setup/oracleUp -patchn21523375 -oh /u01/app/11.2.0/grid/ -ocmrf /u01/app/oracle/psu/ocm.rsp-paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params
  4. 6.

  5. This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2015-11-16_15-39-09.log
  6. 8.

  7. This file will show your detected configuration and all the stepsthat opatchauto attempted to do on your system:
  8. /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2015-11-16_15-39-09.report.log
  9. 11.

  10. 2015-11-16 15:39:09: Starting Clusterware Patch Setup
  11. Using configuration parameter file:/u01/app/11.2.0/grid/crs/install/crsconfig_params
  12. 14.

  13. Stopping CRS…
  14. Stopped CRS successfully
  15. 17.

  16. patch /setup/oracleUp/21523375/21352635 apply successful for home /u01/app/11.2.0/grid
  17. patch /setup/oracleUp/21523375/21352649 apply successful for home /u01/app/11.2.0/grid
  18. patch /setup/oracleUp/21523375/21352642 apply successful for home /u01/app/11.2.0/grid
  19. 21.

  20. Starting CRS…
  21. Installing Trace File Analyzer
  22. CRS-4123: Oracle High Availability Services has been started.
  23. 25.

  24. opatch auto succeeded.

2、上述执行完毕后,再在rac2上执行:

root用户执行

view plain copy

  1. [root@rac2 ~]# /u01/app/11.2.0/grid/OPatch/opatch auto /setup/oracleUp/21523375 -oh /u01/app/11.2.0/grid/ -ocmrf /u01/app/oracle/psu/ocm.rsp

四:给DB HOME安装补丁集

1、rac1:

root用户执行

view plain copy

  1. [root@rac1 ~]#/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch auto /setup/oracleUp/21523375 -oh /u01/app/oracle/product/11.2.0/db_1 -ocmrf /u01/app/oracle/psu/ocm.rsp
  2. 2. 3.

  3. Executing /u01/app/11.2.0/grid/perl/bin/perl/u01/app/oracle/product/11.2.0/db_1/OPatch/crs/patch11203.pl -patchdir/setup/oracleUp -patchn 21523375 -oh /u01/app/oracle/product/11.2.0/db_1 -ocmrf/u01/app/oracle/psu/ocm.rsp -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params
  4. 5.

  5. This is the main log file:/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatchauto2015-11-16_16-31-45.log
  6. 7.

  7. This file will show your detected configuration and all the stepsthat opatchauto attempted to do on your system:
  8. /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatchauto2015-11-16_16-31-45.report.log
  9. 10.

  10. 2015-11-16 16:31:45: Starting Clusterware Patch Setup
  11. Using configuration parameter file:/u01/app/11.2.0/grid/crs/install/crsconfig_params
  12. 13.

  13. Stopping RAC /u01/app/oracle/product/11.2.0/db_1 …
  14. Stopped RAC /u01/app/oracle/product/11.2.0/db_1 successfully
  15. 16.

  16. patch /setup/oracleUp/21523375/21352635 apply successful for home /u01/app/oracle/product/11.2.0/db_1
  17. patch /setup/oracleUp/21523375/21352649/custom/server/21352649 apply successful for home /u01/app/oracle/product/11.2.0/db_1
  18. 19.

  19. Starting RAC /u01/app/oracle/product/11.2.0/db_1 …
  20. Started RAC /u01/app/oracle/product/11.2.0/db_1 successfully
  21. 22.

  22. opatch auto succeeded.

2、上述执行完毕后,再在rac2上执行:

root用户执行

view plain copy

  1. [root@rac2 ~]#/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch auto /setup/oracleUp/21523375 -oh /u01/app/oracle/product/11.2.0/db_1 -ocmrf /u01/app/oracle/psu/ocm.rsp

五:更新dba_registry_history视图信息

view plain copy

  1. [oracle@rac1 ~]$ sqlplus / as sysdba
  2. 2.

  3. SQL>@?/rdbms/admin/catbundle.sqlpsu apply

view plain copy

  1. SQL>select action,comments from registry$history;
  2. 2.

  3. ACTION COMMENTS
  4. ———- ———-
  5. APPLY Patchset 11.2.0.2.0
  6. APPLY PSU 11.2.0.4.8
  7. 7.

  8. 2 rows selected

六:检查GI及oracle版本

查看rac1和rac2两个节点的GI和oracle版本,下面以rac1为例

查看GI版本,已升级到11.2.0.4.8

1756814879372-9e37c7b9-0e68-4751-8940-882483b659fb.png

查看oracle版本,已升级到11.2.0.4.8

1756814879457-1385c288-585e-4ebe-8638-ffcfcc9d045e.png