环境 操作系统:RedHatEnterprise Server 7.1 for x86_64 数据库:ORACLE 11.2.0.4.0 x86_64 RAC 第一部分 安装PSU 以下内容分别在RAC 两个节点操作,操作前,系统的监听都处于开启状态。 1. 登录root,将PSU包(19380115)上传到GRID_HOME目录下 [root@kydb1 ~]# cd /u01/app/11.2.0/grid [root@kydb1 grid]# chmod -R 777 19380115/ [root@kydb1 grid]# ll drwxrwxrwx 2 root root 6 Oct 21 14:29 19380115 ... 2. 所有节点的GRID_opatch和ORACLE_opatch 版本至少要11.2.0.3.6或更新 [root@kydb1~]# /u01/app/11.2.0/grid/OPatch/opatch version OPatch Version: 11.2.0.3.6 OPatch succeeded. [root@kydb1~]# /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch version OPatch Version: 11.2.0.3.6 OPatch succeeded. 3. 创建OCM响应文件 3.1 GRID_HOME [root@kydb1~]# cd /u01/app/11.2.0/grid/OPatch/ocm/bin [root@kydb1bin]# ll total 12 -rwxr----- 1 grid oinstall 9063 Nov 27 2009 emocmrsp [root@kydb1bin]# ./emocmrsp OCM Installation Response Generator 10.3.4.0.0 -Production Copyright (c) 2005, 2010, Oracle and/or itsaffiliates. All rights reserved. Provide your email address to be informed of securityissues, install and initiate Oracle Configuration Manager. Easier for youif you use your My Oracle Support Email address/User Name. Email address/User Name: You have not provided an email address fornotification of security issues. Do you wish to remain uninformed of security issues([Y]es, [N]o) [N]: Y The OCM configuration response file (ocm.rsp) wassuccessfully created. [root@kydb1bin]# ll total 16 -rwxr----- 1 grid oinstall 9063 Nov 27 2009 emocmrsp -rw-r--r-- 1 root root 621 Oct 21 14:45 ocm.rsp [root@kydb1bin]# chmod 777 ocm.rsp [root@kydb1bin]# ll total 16 -rwxr----- 1 grid oinstall 9063 Nov 27 2009 emocmrsp -rwxrwxrwx 1 root root 621 Oct 21 14:45 ocm.rsp [root@kydb1 bin]# 3.2 ORACLE_HOME [root@kydb1~]# cd /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/ocm/bin [root@kydb1bin]# ll total 12 -rwxr----- 1 oracle oinstall 9063 Nov 27 2009 emocmrsp [root@kydb1bin]# ./emocmrsp OCM Installation Response Generator 10.3.4.0.0 -Production Copyright (c) 2005, 2010, Oracle and/or itsaffiliates. All rights reserved. Provide your email address to be informed of securityissues, install and initiate Oracle Configuration Manager. Easier for youif you use your My Oracle Support Email address/User Name. Email address/User Name: You have not provided an email address fornotification of security issues. Do you wish to remain uninformed of security issues([Y]es, [N]o) [N]: Y The OCM configuration response file (ocm.rsp) wassuccessfully created. [root@kydb1bin]# ll total 16 -rwxr----- 1 oracle oinstall 9063 Nov 27 2009 emocmrsp -rw-r--r-- 1 root root 621 Oct 21 15:04 ocm.rsp [root@kydb1bin]# chmod 777 ocm.rsp [root@kydb1bin]# ll total 16 -rwxr----- 1 oracle oinstall 9063 Nov 27 2009 emocmrsp -rwxrwxrwx 1 root root 621 Oct 21 15:04 ocm.rsp 4. 打PSU [root@kydb1 ~]# exportORACLE_HOME=/u01/app/11.2.0/grid [root@kydb1 ~]# cd $ORACLE_HOME [root@kydb1 grid]# cd 19380115/ [root@kydb1 19380115]# ls 19121549 19121551 19121552 PatchSearch.xml README.html README.txt bundle.xml [root@kydb119380115]# $ORACLE_HOME/OPatch/opatch auto -oh $ORACLE_HOME -ocmrf $ORACLE_HOME/OPatch/ocm/bin/ocm.rsp Executing /u01/app/11.2.0/grid/perl/bin/perl/u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /u01/app/11.2.0/grid-patchn 19380115 -oh /u01/app/11.2.0/grid -ocmrf /u01/app/11.2.0/grid/OPatch/ocm/bin/ocm.rsp-paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params This is the main log file:/u01/app/11.2.0/grid/cfgtoollogs/opatchauto2015-10-21_10-37-21.log This file will show your detected configuration andall the steps that opatchauto attempted to do on your system: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2015-10-21_10-37-21.report.log 2015-10-21 10:37:21: Starting ClusterwarePatch Setup Using configuration parameter file:/u01/app/11.2.0/grid/crs/install/crsconfig_params Stopping CRS... Stopped CRS successfully patch/u01/app/11.2.0/grid/19380115/19121551 apply successful for home /u01/app/11.2.0/grid patch/u01/app/11.2.0/grid/19380115/19121549 apply successful for home /u01/app/11.2.0/grid patch/u01/app/11.2.0/grid/19380115/19121552 apply successful for home /u01/app/11.2.0/grid Starting CRS... Installing Trace File Analyzer CRS-4123: Oracle High AvailabilityServices has been started. opatch auto succeeded. [root@kydb119380115]# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 [root@kydb219380115]# $ORACLE_HOME/OPatch/opatch auto -oh $ORACLE_HOME -ocmrf$ORACCLE_HOME/OPatch/ocm/bin/emocmrsp Executing /u01/app/11.2.0/grid/perl/bin/perl/u01/app/oracle/product/11.2.0/dbhome_1/OPatch/crs/patch11203.pl -patchdir/u01/app/11.2.0/grid -patchn 19380115 -oh/u01/app/oracle/product/11.2.0/dbhome_1 -ocmrf/u01/app/oracle/product/11.2.0/dbhome_1/OPatch/ocm/bin/ocm.rsp -paramfile/u01/app/11.2.0/grid/crs/install/crsconfig_params This is the main log file:/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2015-10-21_13-14-54.log This file will show your detected configuration andall the steps that opatchauto attempted to do on your system: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2015-10-21_13-14-54.report.log 2015-10-21 13:14:54: Starting ClusterwarePatch 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/u01/app/11.2.0/grid/19380115/19121551 apply successful for home /u01/app/oracle/product/11.2.0/dbhome_1 patch/u01/app/11.2.0/grid/19380115/19121549/custom/server/19121549 apply successful for home /u01/app/oracle/product/11.2.0/dbhome_1 Starting RAC/u01/app/oracle/product/11.2.0/dbhome_1 ... Started RAC/u01/app/oracle/product/11.2.0/dbhome_1 successfully opatchauto succeeded. [root@kydb2 19380115]# 错误示例: 在ORACLE_HOME打PSU,如果提示failed时(如下), patch /u01/app/11.2.0/grid/19380115/19121551 apply failed for home /u01/app/oracle/product/11.2.0/dbhome_1 可能需要重新启动服务器和CRS,待CRS正常启动后再打PSU。 第二部分 配置升级脚本,验证PSU 1. 配置升级脚本 手动启动两台服务器的监听,登陆节点2操作(在节点1操作也可以) [oracle@kydb2 ~]$ lsnrctl start listener2 LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 21-OCT-2015 13:18:59 Copyright (c) 1991, 2013, Oracle. All rights reserved. Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: pleasewait... TNSLSNR for Linux: Version 11.2.0.4.0 - Production Systemparameter file is/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/kydb2/listener2/alert/log.xml Listening on DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.12.43)(PORT=1550))) Listening on DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.12.41)(PORT=1550))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=kydb2-vip)(PORT=1550))) STATUS of the LISTENER ------------------------ Alias listener2 Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 21-OCT-2015 13:18:59 Uptime 0days 0 hr. 0 min. 0 sec Trace Level off Security ON:Local OS Authentication SNMP OFF ListenerParameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/kydb2/listener2/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.12.43)(PORT=1550))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.12.41)(PORT=1550))) The listener supports no services The command completed successfully [oracle@kydb2 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0Production on Wed Oct 21 13:19:04 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise EditionRelease 11.2.0.4.0 - 64bit Production With the Partitioning, Real ApplicationClusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testingoptions SQL> @?/rdbms/admin/catbundle.sqlpsu apply PL/SQL procedure successfully completed. Function created. Function created. PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. Generating apply and rollback scripts... Check the following file for errors: ............. 5 VALUES 6 (SYSTIMESTAMP, 'APPLY', 7 SYS_CONTEXT('REGISTRY$CTX','NAMESPACE'), 8 '11.2.0.4', 9 4, 10 'PSU', 11 'PSU 11.2.0.4.4'); 1 row created. SQL> COMMIT; Commit complete. SQL> SPOOL off SQL> SET echo off Check the following log file for errors: /u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_KYDB_APPLY_2015Oct21_13_20_38.log SQL> set linesize 350 SQL> col action_time for a30 SQL> col version for a15 SQL> col id for 99 SQL> col action for a10 SQL> col namespace for a10 SQL> col COMMENTS for a20 SQL> col BUNDLE_SERIES for a15 SQL> select * fromregistry$history; ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SERIES ---------------------------------------- ---------- --------------- --- -------------------- --------------- 24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 Patchset 11.2.0.2.0 PSU 23-JUL-15 02.51.17.873719 PM APPLY SERVER 11.2.0.4 0 Patchset 11.2.0.2.0 PSU 20-OCT-15 06.05.53.820920 PM APPLY SERVER 11.2.0.4 4 PSU 11.2.0.4.4 PSU 21-OCT-15 10.49.51.080543 AM APPLY SERVER 11.2.0.4 0 Patchset 11.2.0.2.0 PSU 21-OCT-15 01.20.39.591282 PM APPLY SERVER 11.2.0.4 4 PSU 11.2.0.4.4 PSU 2. 验证PSU [oracle@kydb2 ~]$ $ORACLE_HOME/OPatch/opatch lspatches 19121549;OCW Patch Set Update: 11.2.0.4.4 (19121549) 19121551;Database Patch Set Update :11.2.0.4.4 (19121551) [oracle@kydb2 ~]$ su - grid Password: Last login: Wed Oct 2115:45:40 CST 2015 from kydb1 on pts/2 [grid@kydb2 ~]$$ORACLE_HOME/OPatch/opatch lspatches 19121552;ACFS PATCH SETUPDATE : 11.2.0.4.4 (19121552) 19121549;OCW Patch Set Update : 11.2.0.4.4(19121549) 19121551;Database Patch Set Update :11.2.0.4.4 (19121551) [grid@kydb2 ~]$ [oracle@kydb1 ~]$$ORACLE_HOME/OPatch/opatch lspatches 19121549;OCW Patch Set Update : 11.2.0.4.4(19121549) 19121551;Database Patch Set Update :11.2.0.4.4 (19121551) [oracle@kydb1 ~]$ su - grid Password: Last login: Wed Oct 2115:50:23 CST 2015 on pts/6 [grid@kydb1 ~]$$ORACLE_HOME/OPatch/opatch lspatches 19121552;ACFS PATCH SETUPDATE : 11.2.0.4.4 (19121552) 19121549;OCW Patch Set Update : 11.2.0.4.4(19121549) 19121551;Database Patch Set Update :11.2.0.4.4 (19121551)
|