11g RAC 自动升级 PSU
[oracle@uudb1 ~]$ cd $ORACLE_HOME
[oracle@uudb1 db_1]$ cd OPatch/
[oracle@uudb1 OPatch]$ ls
crs docs emdpatch.pl jlib ocm opatch opatch.bat opatchdiag opatchdiag.bat opatch.ini opatch.pl opatchprereqs oplan
[oracle@uudb1 OPatch]$ ./opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[oracle@uudb1 OPatch]$ ./opatch lspatches
There are no Interim patches installed in this Oracle Home.
[grid@uudb1 ~]$ cd $ORACLE_HOME
[grid@uudb1 grid]$ cd OPatch/
[grid@uudb1 OPatch]$ ./opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[grid@uudb1 OPatch]$ ./opatch lspatches
There are no Interim patches installed in this Oracle Home.
[grid@uudb1 OPatch]$
[oracle@uudb2 ~]$ cd $ORACLE_HOME
[oracle@uudb2 db_1]$ cd OPatch/
[oracle@uudb2 OPatch]$ ./opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[oracle@uudb2 OPatch]$ ./opatch lspatches
There are no Interim patches installed in this Oracle Home.
[grid@uudb2 ~]$ cd $ORACLE_HOME
[grid@uudb2 grid]$ cd OPatch/
[grid@uudb2 OPatch]$ ./opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[grid@uudb2 OPatch]$ ./opatch lspatches
There are no Interim patches installed in this Oracle Home.
----升级---节点1
[oracle@uudb1 OPatch]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
[oracle@uudb1 OPatch]$ cp /soft/p6880880_112000_Linux-x86-64.zip ./..
[oracle@uudb1 OPatch]$ cd ..
[oracle@uudb1 db_1]$ unzip p6880880_112000_Linux-x86-64.zip
[oracle@uudb1 db_1]$ chmod 755 OPatch
[oracle@uudb1 db_1]$ cd OPatch
[oracle@uudb1 OPatch]$ ./opatch version
OPatch Version: 11.2.0.3.12
--root用户
[root@uudb1 soft]# cd /u01/11.2.0
[root@uudb1 11.2.0]# pwd
/u01/11.2.0
[root@uudb1 11.2.0]# chown grid.oinstall grid/
[root@uudb1 soft]# cp p6880880_112000_Linux-x86-64.zip /u01/11.2.0/grid/
[root@uudb1 soft]# chown grid.oinstall /u01/11.2.0/grid/p6880880_112000_Linux-x86-64.zip
--grid 用户
[grid@uudb1 grid]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
[grid@uudb1 grid]$ unzip p6880880_112000_Linux-x86-64.zip
---升级 节点2
[oracle@uudb2 OPatch]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
[oracle@uudb2 OPatch]$ cd ..
[oracle@uudb2 db_1]$ cp /soft/p6880880_112000_Linux-x86-64.zip ./
[oracle@uudb2 db_1]$ unzip p6880880_112000_Linux-x86-64.zip
[oracle@uudb2 db_1]$ chmod 755 OPatch
[oracle@uudb2 db_1]$ cd OPatch
[oracle@uudb2 OPatch]$ ./opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[oracle@uudb2 OPatch]$
---root用户
[root@uudb2 ~]# cd /u01/11.2.0
[root@uudb2 11.2.0]# ll -d grid/
drwxr-xr-x 68 root oinstall 4096 Mar 14 11:56 grid/
[root@uudb2 11.2.0]# chown grid.oinstall grid/
[root@uudb2 11.2.0]# cp /soft/p6880880_112000_Linux-x86-64.zip /u01/11.2.0/grid/
[root@uudb2 11.2.0]# chown grid.oinstall /u01/11.2.0/grid/p6880880_112000_Linux-x86-64.zip
--grid
[grid@uudb2 OPatch]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
[grid@uudb2 OPatch]$ cd $ORACLE_HOME
[grid@uudb2 grid]$ unzip p6880880_112000_Linux-x86-64.zip
[grid@uudb2 grid]$ chmod 755 OPatch -R
[grid@uudb2 grid]$ cd OPatch
[grid@uudb2 OPatch]$ ./opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[grid@uudb2 OPatch]$
----
----下载对应PSU+SPU 补丁包
--下载路径
http://www.oracle.com/technetwork/topics/security/alerts-086861.html
p28429134_112040_Linux-x86-64.zip
---生成对应文件/tmp/ocm.rsp
--两个节点分别生成这个文件
grid 用户
生成ocm.rsp文件
cd /u01/11.2.0/grid/OPatch/ocm/bin
./emocmrsp -output /tmp/ocm.rsp
chmod 775 /tmp/ocm.rsp
grid用户--检查
cd $ORACLE_HOME/OPatch
./opatch lsinventory -detail -oh /u01/11.2.0/grid
root用户---两个节点
cd /soft
unzip p28429134_112040_Linux-x86-64.zip
修改补丁目录权限(两个节点)
cd /soft/
chown -R grid:oinstall 28429134/
chmod 755 28429134/
root用户执行,分别在两个节点执行,先执行节点1、在执行节点2
grid 用户家目录 auto PSU解压路径 -ocmrf grid用户生成ocm.rsp文件的路径
/u01/11.2.0/grid/OPatch/opatch auto /soft/gpsu/28429134 -ocmrf /tmp/ocm.rsp
[root@uudb1 gpsu]# /u01/11.2.0/grid/OPatch/opatch auto /soft/gpsu/28429134 -ocmrf /tmp/ocm.rsp
Can't locate Switch.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /u01/11.2.0/grid/OPatch/crs/auto_patch.pl line 2734.
BEGIN failed--compilation aborted at /u01/11.2.0/grid/OPatch/crs/auto_patch.pl line 2734.
--上面报错解决办法
yum install -y perl-Switch
---节点1执行
/u01/11.2.0/grid/OPatch/opatch auto /soft/28429134 -ocmrf /tmp/ocm.rsp
[root@uudb1 soft]# /u01/11.2.0/grid/OPatch/opatch auto /soft/28429134 -ocmrf /tmp/ocm.rsp
Executing /u01/11.2.0/grid/perl/bin/perl /u01/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /soft -patchn 28429134 -ocmrf /tmp/ocm.rsp -paramfile /u01/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/11.2.0/grid/cfgtoollogs/opatchauto2019-03-14_15-29-56.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/11.2.0/grid/cfgtoollogs/opatchauto2019-03-14_15-29-56.report.log
2019-03-14 15:29:56: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/11.2.0/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/oracle/product/11.2.0/db_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/db_1 successfully
patch /soft/28429134/27735020/custom/server/27735020 apply successful for home /u01/app/oracle/product/11.2.0/db_1
patch /soft/28429134/28204707 apply successful for home /u01/app/oracle/product/11.2.0/db_1
Stopping CRS...
Stopped CRS successfully
patch /soft/28429134/27735020 apply successful for home /u01/11.2.0/grid
patch /soft/28429134/28204707 apply successful for home /u01/11.2.0/grid
patch /soft/28429134/28204939 apply successful for home /u01/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/db_1 ...
Started RAC /u01/app/oracle/product/11.2.0/db_1 successfully
opatch auto succeeded.
---节点2执行
/u01/11.2.0/grid/OPatch/opatch auto /soft/28429134 -ocmrf /tmp/ocm.rsp
[root@uudb2 soft]# /u01/11.2.0/grid/OPatch/opatch auto /soft/28429134 -ocmrf /tmp/ocm.rsp
Executing /u01/11.2.0/grid/perl/bin/perl /u01/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /soft -patchn 28429134 -ocmrf /tmp/ocm.rsp -paramfile /u01/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/11.2.0/grid/cfgtoollogs/opatchauto2019-03-14_15-44-28.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/11.2.0/grid/cfgtoollogs/opatchauto2019-03-14_15-44-28.report.log
2019-03-14 15:44:28: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/11.2.0/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/oracle/product/11.2.0/db_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/db_1 successfully
patch /soft/28429134/27735020/custom/server/27735020 apply successful for home /u01/app/oracle/product/11.2.0/db_1
patch /soft/28429134/28204707 apply successful for home /u01/app/oracle/product/11.2.0/db_1
Stopping CRS...
Stopped CRS successfully
patch /soft/28429134/27735020 apply successful for home /u01/11.2.0/grid
patch /soft/28429134/28204707 apply successful for home /u01/11.2.0/grid
patch /soft/28429134/28204939 apply successful for home /u01/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/db_1 ...
Started RAC /u01/app/oracle/product/11.2.0/db_1 successfully
opatch auto succeeded.
----执行相应脚本
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT
dba_registry_history
---编译无效对象
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
16:02:26 SYS@uudb1(usdb1)> /
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SERIES COMMENTS
---------------------------------------- -------------------- -------------------- ------------------------------ -------------- ------------------------------ --------------------------------------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
14-MAR-19 02.18.42.983164 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
14-MAR-19 03.56.26.646656 PM APPLY SERVER 11.2.0.4 181016 PSU PSU 11.2.0.4.181016
16:02:26 SYS@uudb1(usdb1)>
SQL > @dbmsjdev.sql
SQL > exec dbms_java_dev.disable
SQL> col ACTION_TIME for a40
SQL> col NAMESPACE for a20
SQL> col COMMENTS for a50
SQL> col action for a20
SQL> col id for 9999999999999
*******可能报错*********
节点2 alter 日志
Mon Feb 22 11:55:37 2021
NOTE: Loaded library: System
ORA-15025: could not open disk "/dev/asm-data1"
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
启动报错
startup;
ORA-00205: error in identifying control file, check alert log for more info
--解决办法:
[oracle@uudb1 ~]$ ll $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle asmadmin 239826248 Feb 22 11:30 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[oracle@uudb1 ~]$
[root@uudb2 ~]# ll /u01/app/oracle/product/11.2.0/db_1/bin/oracle
-rwsr-s--x 1 oracle oinstall 239826248 Feb 22 11:38 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[root@uudb2 ~]# chown oracle:asmadmin /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[root@uudb2 ~]# ll /u01/app/oracle/product/11.2.0/db_1/bin/oracle
-rwxr-x--x 1 oracle asmadmin 239826248 Feb 22 11:38 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[root@uudb2 ~]# chmod 6751 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[oracle@uudb2 ~]$ ll $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle asmadmin 239826248 Feb 22 11:38 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[oracle@uudb2 ~]$