1、环境
DB:两节点RAC 11.2.0.4.0升级至11.2.0.4.6
OS:AIX 7.1(205G内存 16C)
2、节点1、节点2(未建库)
2.1、patch 20420937居然用了3个小时才跑完
DB1:/ #/oracle/app/11.2.0/grid/OPatch/opatch auto /oracle/patch/20485808 -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /oracle/patch -patchn 20485808 -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2019-01-21_16-25-37.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2019-01-21_16-25-37.report.log
2019-01-21 16:25:37: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /oracle/patch/20485808/20299013 apply successful for home /oracle/app/11.2.0/grid
patch /oracle/patch/20485808/20420937 apply successful for home /oracle/app/11.2.0/grid >>>>>>>>>>>>>>>>>>>>>>>>>>这里居然执行了将近3个小时
patch /oracle/patch/20485808/20299019 apply successful for home /oracle/app/11.2.0/grid
Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.
opatch auto succeeded.
DB1:/ #
2.2、opatchauto report日志
DB1:/ #cat /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2019-01-21_16-25-37.report.log
*********** Configuration Data ***********
* It shows only those targets that will be patched in this session *
crs_home=/oracle/app/11.2.0/grid owner=grid opatch_ver=11.2.0.3.20
*********** Steps to be executed as owner unless specified as root ***********
1: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /oracle/patch/20485808/20299013 -oh /oracle/app/11.2.0/grid
2: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /oracle/patch/20485808/20420937 -oh /oracle/app/11.2.0/grid
3: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /oracle/patch/20485808/20299019 -oh /oracle/app/11.2.0/grid
4: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /oracle/patch/20485808/20299013 -oh /oracle/app/11.2.0/grid
5: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /oracle/patch/20485808/20420937 -oh /oracle/app/11.2.0/grid
6: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /oracle/patch/20485808/20299019 -oh /oracle/app/11.2.0/grid
7: /oracle/app/11.2.0/grid/crs/install/rootcrs.pl -unlock : run as root
8: /usr/sbin/fuser -k /oracle/app/11.2.0/grid/bin/crsctl.bin : run as root
9: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /oracle/patch/20485808/20299013 -oh /oracle/app/11.2.0/grid
10: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /oracle/patch/20485808/20420937 -oh /oracle/app/11.2.0/grid
11: /oracle/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /oracle/patch/20485808/20299019 -oh /oracle/app/11.2.0/grid
12: /usr/sbin/slibclean : run as root
13: /oracle/app/11.2.0/grid/OPatch/opatch napply /oracle/patch/20485808/20299013 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/11.2.0/grid -invPtrLoc /oracle/app/11.2.0/grid/oraInst.loc
14: /oracle/app/11.2.0/grid/OPatch/opatch napply /oracle/patch/20485808/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/11.2.0/grid -invPtrLoc /oracle/app/11.2.0/grid/oraInst.loc
15: /oracle/app/11.2.0/grid/OPatch/opatch napply /oracle/patch/20485808/20299019 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/11.2.0/grid -invPtrLoc /oracle/app/11.2.0/grid/oraInst.loc
16: /oracle/app/11.2.0/grid/bin/emctl start dbconsole
17: /oracle/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh : run as root
18: /oracle/app/11.2.0/grid/crs/install/rootcrs.pl -patch : run as root
2.3、opatchauto日志
tail -f /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2019-01-21_16-25-37.log
...
2019-01-21 16:34:48: patch /oracle/patch/20485808/20299013 apply successful for home /oracle/app/11.2.0/grid
2019-01-21 16:34:48: Executing command /oracle/app/11.2.0/grid/OPatch/opatch napply /oracle/patch/20485808/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/11.2.0/grid -invPtrLoc /oracle/app/11.2.
0/grid/oraInst.loc as grid
2019-01-21 16:34:48: Running as user grid: /oracle/app/11.2.0/grid/OPatch/opatch napply /oracle/patch/20485808/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/11.2.0/grid -invPtrLoc /oracle/app/1
1.2.0/grid/oraInst.loc
2019-01-21 16:34:48: s_run_as_user2: Running /bin/su grid -c ' /oracle/app/11.2.0/grid/OPatch/opatch napply /oracle/patch/20485808/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/11.2.0/grid -inv
PtrLoc /oracle/app/11.2.0/grid/oraInst.loc ' >>>>>>>>>>>>>>>>>>>>>>>>>>这里居然执行了将近3个小时
2019-01-21 19:32:40: Removing file /tmp/uaamQDaau
2019-01-21 19:32:40: Successfully removed file: /tmp/uaamQDaau
2019-01-21 19:32:40: /bin/su successfully executed
...
3、节点1、节点2(DBCA建库后补丁信息)
DB1:/ #su - oracle
DB1:/home/oracle $$ORACLE_HOME/OPatch/opatch lspatches
There are no Interim patches installed in this Oracle Home "/oracle/app/oracle/product/11.2.0/db".
OPatch succeeded.
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SERIES COMMENTS
------------------------------ -------------------- ---------- ---------------------------- ---------- --------------- ----------------------------------------
2013-10-01 22:55:45.938537 APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
2019-01-22 14:02:01.771369 APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
由上述输出得知,在未DBCA建库之前使用auto方式打补丁是不会apply到oracle soft上的
4、节点1、节点2(DBCA建库后打补丁)
4.1、使用auto打DB的补丁,CRS的会自动跳过
DB1:/ #/oracle/app/11.2.0/grid/OPatch/opatch auto /oracle/patch/20485808 -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /oracle/patch -patchn 20485808 -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2019-01-22_14-58-03.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2019-01-22_14-58-03.report.log
2019-01-22 14:58:03: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Stopping RAC /oracle/app/oracle/product/11.2.0/db ...
Stopped RAC /oracle/app/oracle/product/11.2.0/db successfully
patch /oracle/patch/20485808/20299013 apply successful for home /oracle/app/oracle/product/11.2.0/db
patch /oracle/patch/20485808/20420937/custom/server/20420937 apply successful for home /oracle/app/oracle/product/11.2.0/db
Stopping CRS...
Stopped CRS successfully
Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.
Starting RAC /oracle/app/oracle/product/11.2.0/db ...
Started RAC /oracle/app/oracle/product/11.2.0/db successfully
opatch auto succeeded.
DB1:/ #
4.2、opatchauto report日志
DB1:/ #cat /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2019-01-22_14-58-03.report.log
*********** Configuration Data ***********
* It shows only those targets that will be patched in this session *
crs_home=/oracle/app/11.2.0/grid owner=grid opatch_ver=11.2.0.3.20
rac_home=/oracle/app/oracle/product/11.2.0/db owner=oracle opatch_ver=11.2.0.3.20
*********** Steps to be executed as owner unless specified as root ***********
1: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch prereq CheckComponents -ph /oracle/patch/20485808/20299013 -oh /oracle/app/oracle/product/11.2.0/db
2: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch prereq CheckComponents -ph /oracle/patch/20485808/20420937/custom/server/20420937 -oh /oracle/app/oracle/product/11.2.0/db
3: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch prereq CheckConflictAgainstOH -ph /oracle/patch/20485808/20299013 -oh /oracle/app/oracle/product/11.2.0/db
4: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch prereq CheckConflictAgainstOH -ph /oracle/patch/20485808/20420937/custom/server/20420937 -oh /oracle/app/oracle/product/11.2.0/db
5: /oracle/app/oracle/product/11.2.0/db/bin/emctl stop dbconsole
6: /oracle/app/oracle/product/11.2.0/db/bin/emctl stop agent
7: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch prereq CheckApplicable -ph /oracle/patch/20485808/20299013 -oh /oracle/app/oracle/product/11.2.0/db
8: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch prereq CheckApplicable -ph /oracle/patch/20485808/20420937/custom/server/20420937 -oh /oracle/app/oracle/product/11.2.0/db
9: /oracle/app/oracle/product/11.2.0/db/bin/srvctl stop home -o /oracle/app/oracle/product/11.2.0/db -s /oracle/app/oracle/product/11.2.0/db/srvm/admin/stophome.txt -n DB1 -f
10: /oracle/patch/20485808/20420937/custom/server/20420937/custom/scripts/prepatch.sh -dbhome /oracle/app/oracle/product/11.2.0/db
11: /usr/sbin/slibclean : run as root
12: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch napply /oracle/patch/20485808/20299013 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/oracle/product/11.2.0/db -invPtrLoc /oracle/app/oracle/product/11.2.0/db/oraInst.loc
13: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch napply /oracle/patch/20485808/20420937/custom/server/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/oracle/product/11.2.0/db -invPtrLoc /oracle/app/oracle/product/11.2.0/db/oraInst.loc
14: /oracle/patch/20485808/20420937/custom/server/20420937/custom/scripts/postpatch.sh -dbhome /oracle/app/oracle/product/11.2.0/db
15: /oracle/app/11.2.0/grid/crs/install/rootcrs.pl -unlock : run as root
16: /oracle/app/11.2.0/grid/tfa/bin/tfactl stop : run as root
17: /usr/sbin/fuser -k /oracle/app/11.2.0/grid/bin/crsctl.bin : run as root
18: /usr/sbin/slibclean : run as root
19: /oracle/app/11.2.0/grid/bin/emctl start dbconsole
20: /oracle/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh : run as root
21: /oracle/app/11.2.0/grid/crs/install/rootcrs.pl -patch : run as root
22: /oracle/app/oracle/product/11.2.0/db/bin/emctl start dbconsole
23: /oracle/app/oracle/product/11.2.0/db/bin/emctl start agent
24: /oracle/app/oracle/product/11.2.0/db/bin/srvctl start home -o /oracle/app/oracle/product/11.2.0/db -s /oracle/app/oracle/product/11.2.0/db/srvm/admin/stophome.txt -n DB1
DB1:/ #
4.3、opatchauto日志
...
2019-01-22 15:06:12: patch /oracle/patch/20485808/20299013 apply successful for home /oracle/app/oracle/product/11.2.0/db
2019-01-22 15:06:12: Executing command /oracle/app/oracle/product/11.2.0/db/OPatch/opatch napply /oracle/patch/20485808/20420937/custom/server/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/app/orac
le/product/11.2.0/db -invPtrLoc /oracle/app/oracle/product/11.2.0/db/oraInst.loc as oracle
2019-01-22 15:06:12: Running as user oracle: /oracle/app/oracle/product/11.2.0/db/OPatch/opatch napply /oracle/patch/20485808/20420937/custom/server/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/ocm.rsp -oh /oracle/ap
p/oracle/product/11.2.0/db -invPtrLoc /oracle/app/oracle/product/11.2.0/db/oraInst.loc
2019-01-22 15:06:12: s_run_as_user2: Running /bin/su oracle -c ' /oracle/app/oracle/product/11.2.0/db/OPatch/opatch napply /oracle/patch/20485808/20420937/custom/server/20420937 -local -silent -ocmrf /oracle/app/11.2.0/grid/OPatch/ocm/oc
m.rsp -oh /oracle/app/oracle/product/11.2.0/db -invPtrLoc /oracle/app/oracle/product/11.2.0/db/oraInst.loc ' >>>>>>>>>>>>>>>>10分钟
2019-01-22 15:16:14: Removing file /tmp/yaaC3Jqay
...
5、更新数据字典
cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
@catbundle.sql psu apply
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SERIES COMMENTS
------------------------------ -------------------- ---------- ---------------------------- ---------- --------------- ----------------------------------------
2013-10-01 22:55:45.938537 APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
2019-01-22 14:02:01.771369 APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
2019-01-22 15:58:32.917047 APPLY SERVER 11.2.0.4 6 PSU PSU 11.2.0.4.6