GI PSU打補丁之opatch auto 自動方式分別打GI_HOME和ORACLE_HOME
11.2.0.4 rac資料庫打補丁:
環境說明:
[oracle@dbrac1 ~]$ cat /etc/issue
Red Hat Enterprise Linux Server release 6.7 (Santiago)
Kernel \r on an \m
[oracle@dbrac1 ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.2 dbrac1
192.168.56.3 dbrac1-vip
10.10.10.10 dbrac1-priv
192.168.56.4 dbrac2
192.168.56.5 dbrac2-vip
10.10.10.11 dbrac2-priv
192.168.56.8 rac-scan
[oracle@dbrac1 ~]$
要打的補丁為:p27107360_112040_Linux-x86-64.zip,opatch工具包:p6880880_112000_Linux-x86-64.zip
節點一二都把上述兩包放在/tmp下,且賦許可權為chmod 777 *.zip
[root@dbrac1 tmp]# ll *.zip
-rwxrwxrwx 1 root root 779304336 Apr 2 17:12 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 Mar 14 2016 p6880880_112000_Linux-x86-64.zip
[root@dbrac1 tmp]#
一:升級OPatch
下載最新的opatch程式並替換GI_HOME和ORACLE_HOME下的OPatch目錄
注意:rac1和rac2兩個節點的grid和oracle都要升級OPatch版本
[grid@dbrac1 ~]$ opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[grid@dbrac1 ~]$
[oracle@dbrac1 ~]$ opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[oracle@dbrac1 ~]$
oracle使用者替換,備份之前的OPatch目錄:
[oracle@dbrac1 ~]$ cd $ORACLE_HOME
[oracle@dbrac1 dbhome_1]$
[oracle@dbrac1 dbhome_1]$ mv OPatch/ OPatch.bak
--解壓:
[oracle@dbrac1 tmp]$ unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME
Archive: p6880880_112000_Linux-x86-64.zip
creating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/
inflating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatchdiag
inflating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch.pl
creating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/jlib/
忽略..............................................................................
[oracle@dbrac1 dbhome_1]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[oracle@dbrac1 dbhome_1]$
grid使用者替換,備份之前的OPatch目錄:
[grid@dbrac1 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/11.2.0/grid
[grid@dbrac1 ~]$ exit
logout
[root@dbrac1 tmp]#
[root@dbrac1 tmp]# cd /oracle/app/11.2.0/grid
[root@dbrac1 grid]#
[root@dbrac1 grid]# mv OPatch/ OPatch.bak
[root@dbrac1 grid]#
[root@dbrac1 tmp]# cd /tmp
[root@dbrac1 tmp]# ll *.zip
-rwxrwxrwx 1 root root 779304336 Apr 2 17:12 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 Mar 14 2016 p6880880_112000_Linux-x86-64.zip
[root@dbrac1 tmp]# unzip p6880880_112000_Linux-x86-64.zip -d /oracle/app/11.2.0/grid
Archive: p6880880_112000_Linux-x86-64.zip
creating: /oracle/app/11.2.0/grid/OPatch/
inflating: /oracle/app/11.2.0/grid/OPatch/opatchdiag
inflating: /oracle/app/11.2.0/grid/OPatch/opatch.pl
creating: /oracle/app/11.2.0/grid/OPatch/jlib/
省略............................................................
[root@dbrac1 grid]#
[root@dbrac1 grid]# chown -R grid:oinstall OPatch/
[root@dbrac1 grid]#
[root@dbrac1 grid]# su - grid
[grid@dbrac1 ~]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[grid@dbrac1 ~]$
--節點2相同操作:
[root@dbrac2 tmp]# ll *.zip
-rwxrwxrwx 1 root root 779304336 May 15 09:45 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 May 15 09:45 p6880880_112000_Linux-x86-64.zip
[root@dbrac2 tmp]# su - oracle
[oracle@dbrac2 ~]$
[oracle@dbrac2 ~]$ cd $ORACLE_HOME
[oracle@dbrac2 dbhome_1]$ mv OPatch/ OPatch.bak
[oracle@dbrac2 dbhome_1]$
[oracle@dbrac2 dbhome_1]$ unzip /tmp/p6880880_112000_Linux-x86-64.zip
省略..........................................
[oracle@dbrac2 dbhome_1]$
[oracle@dbrac2 dbhome_1]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[oracle@dbrac2 dbhome_1]$
[root@dbrac2 ~]# su - grid
[grid@dbrac2 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/11.2.0/grid
[grid@dbrac2 ~]$
[grid@dbrac2 ~]$ exit
logout
[root@dbrac2 ~]# cd /tmp
[root@dbrac2 tmp]# cd /oracle/app/11.2.0/grid
[root@dbrac2 grid]# mv OPatch/ OPatch.bak
[root@dbrac2 grid]#
[root@dbrac2 grid]# unzip /tmp/p6880880_112000_Linux-x86-64.zip -d /oracle/app/11.2.0/grid
省略.................................
[root@dbrac2 grid]#
[root@dbrac2 grid]# chown grid:oinstall -R OPatch/
[root@dbrac2 grid]# su - grid
[grid@dbrac2 ~]$
[grid@dbrac2 ~]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[grid@dbrac2 ~]$
二:生成ocm檔案
在rac1和rac2分別生成ocm.rsp檔案。
su - oracle
$ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
[oracle@dbrac1 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
[oracle@dbrac1 ~]$
[oracle@dbrac1 ~]$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
The OCM configuration response file (/home/oracle/ocm.rsp) was successfully created.
[oracle@dbrac1 ~]$
[oracle@dbrac2 ~]$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
The OCM configuration response file (/home/oracle/ocm.rsp) was successfully created.
[oracle@dbrac2 ~]$ ll
total 4
-rw-r--r-- 1 oracle oinstall 623 May 15 20:15 ocm.rsp
[oracle@dbrac2 ~]$
三:給GRID_HOME安裝補丁
注意:雖然,opatch auto命令必須使用root使用者執行,但是其實還是需要透過root使用者su到grid和oracle使用者來執行相關的檢查工作。
--執行前先備份inventory_loc目錄和gird和oracle使用者的軟體目錄即家目錄:
[root@dbrac1 tmp]# cat /etc/oraInst.loc
inventory_loc=/oracle/app/oraInventory
inst_group=oinstall
[root@dbrac1 tmp]#
[root@dbrac1 tmp]# cat /etc/oratab
+ASM1:/oracle/app/11.2.0/grid:N # line added by Agent
dbrac:/oracle/app/oracle/product/11.2.0/dbhome_1:N # line added by Agent
[root@dbrac1 tmp]#
--再在打補丁前先檢查狀態:
[grid@dbrac1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.FRA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER_WANG.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.OCRVOTE.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.asm
ONLINE ONLINE dbrac1 Started
ONLINE ONLINE dbrac2 Started
ora.gsd
OFFLINE OFFLINE dbrac1
OFFLINE OFFLINE dbrac2
ora.net1.network
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.ons
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.registry.acfs
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dbrac2
ora.cvu
1 ONLINE ONLINE dbrac2
ora.dbrac.abcde.svc
1 ONLINE ONLINE dbrac2
ora.dbrac.db
1 ONLINE ONLINE dbrac2 Open
2 ONLINE ONLINE dbrac1 Open
ora.dbrac.dmmservice.svc
1 ONLINE ONLINE dbrac2
ora.dbrac1.vip
1 ONLINE ONLINE dbrac1
ora.dbrac2.vip
1 ONLINE ONLINE dbrac2
ora.oc4j
1 ONLINE ONLINE dbrac2
ora.scan1.vip
1 ONLINE ONLINE dbrac2
[grid@dbrac1 ~]$
--正式打補丁,先打節點一GI_HOME
[grid@dbrac1 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/11.2.0/grid
[grid@dbrac1 tmp]$ which opatch
/oracle/app/11.2.0/grid/OPatch/opatch
[grid@dbrac1 tmp]$
[grid@dbrac1 tmp]$ exit
logout
[root@dbrac1 grid]#
[root@dbrac1 grid]# cd /tmp
[root@dbrac1 tmp]# unzip p27107360_112040_Linux-x86-64.zip
省略....................................................................
[root@dbrac1 tmp]#chown oracle:oinstall -R 27107360/
[root@dbrac1 tmp]# ll
total 812916
drwxr-xr-x 5 oracle oinstall 4096 Dec 6 16:59 27107360
-rwxrwxrwx 1 root root 779304336 Apr 2 17:12 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 Mar 14 2016 p6880880_112000_Linux-x86-64.zip
[root@dbrac1 tmp]#
--grid下打補丁:
/oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/oracle/ocm.rsp
[root@dbrac1 tmp]# /oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/oracle/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/11.2.0/grid -ocmrf /home/oracle/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/opatchauto2018-05-15_17-26-36.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/opatchauto2018-05-15_17-26-36.report.log
2018-05-15 17:26:36: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/26609929 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/22502505 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.
[root@dbrac1 tmp]#
--在打補丁期間在節點2上查詢叢集狀態:發現打補丁時把節點1的db和crs停了;
[grid@dbrac2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dbrac2
ora.FRA.dg
ONLINE ONLINE dbrac2
ora.LISTENER.lsnr
ONLINE ONLINE dbrac2
ora.LISTENER_WANG.lsnr
ONLINE ONLINE dbrac2
ora.OCRVOTE.dg
ONLINE ONLINE dbrac2
ora.asm
ONLINE ONLINE dbrac2 Started
ora.gsd
OFFLINE OFFLINE dbrac2
ora.net1.network
ONLINE ONLINE dbrac2
ora.ons
ONLINE ONLINE dbrac2
ora.registry.acfs
ONLINE ONLINE dbrac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dbrac2
ora.cvu
1 ONLINE ONLINE dbrac2
ora.dbrac.abcde.svc
1 ONLINE ONLINE dbrac2
ora.dbrac.db
1 ONLINE ONLINE dbrac2 Open
2 ONLINE OFFLINE Instance Shutdown
ora.dbrac.dmmservice.svc
1 ONLINE ONLINE dbrac2
ora.dbrac1.vip
1 ONLINE INTERMEDIATE dbrac2 FAILED OVER
ora.dbrac2.vip
1 ONLINE ONLINE dbrac2
ora.oc4j
1 ONLINE ONLINE dbrac2
ora.scan1.vip
1 ONLINE ONLINE dbrac2
[grid@dbrac2 ~]$
--檢查
[root@dbrac1 tmp]# su - grid
[grid@dbrac1 ~]$
[grid@dbrac1 ~]$
[grid@dbrac1 ~]$ opatch lspatches
22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[grid@dbrac1 ~]$
三:給ORACLE_HOME安裝補丁
--給節點1的oracle使用者的ORACLE_HOME打補丁:
[oracle@dbrac1 ~]$ env|grep HOME
HOME=/home/oracle
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
[oracle@dbrac1 ~]$
[oracle@dbrac1 ~]$ exit
logout
[root@dbrac1 soft]#
--執行操作:
/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
[root@dbrac1 soft]# /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_17-56-39.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_17-56-39.report.log
2018-05-15 17:56:39: 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/dbhome_1 ...
Stopped RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
patch /tmp/27107360/26609929/custom/server/26609929 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
Starting RAC /oracle/app/oracle/product/11.2.0/dbhome_1 ...
Started RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
opatch auto succeeded.
[root@dbrac1 soft]#
[grid@dbrac2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.FRA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER_WANG.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.OCRVOTE.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.asm
ONLINE ONLINE dbrac1 Started
ONLINE ONLINE dbrac2 Started
ora.gsd
OFFLINE OFFLINE dbrac1
OFFLINE OFFLINE dbrac2
ora.net1.network
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.ons
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.registry.acfs
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dbrac2
ora.cvu
1 ONLINE ONLINE dbrac2
ora.dbrac.abcde.svc
1 ONLINE ONLINE dbrac2
ora.dbrac.db
1 ONLINE ONLINE dbrac2 Open
2 OFFLINE OFFLINE Instance Shutdown
ora.dbrac.dmmservice.svc
1 ONLINE ONLINE dbrac2
ora.dbrac1.vip
1 ONLINE ONLINE dbrac1
ora.dbrac2.vip
1 ONLINE ONLINE dbrac2
ora.oc4j
1 ONLINE ONLINE dbrac2
ora.scan1.vip
1 ONLINE ONLINE dbrac2
[grid@dbrac2 ~]$
--檢查:
[root@dbrac1 soft]# su - oracle
[oracle@dbrac1 ~]$ opatch lspatches
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[oracle@dbrac1 ~]$
四:給節點2的GI_HOME和ORACLE_HOME分別打補丁,步驟同二三步驟
[root@dbrac2 tmp]# ll
drwxr-xr-x 5 oracle oinstall 4096 Dec 6 16:59 27107360
-rwxrwxrwx 1 root root 779304336 May 15 09:45 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 May 15 09:45 p6880880_112000_Linux-x86-64.zip
[root@dbrac2 tmp]#
[root@dbrac2 tmp]#
--給GI_HOME打補丁:
用ORACLE使用者生成的ocm.rsp相應檔案報錯:Argument(s) Error... Given 'ocmrf' file does not exists. Please check the arguments and try again. OPatch failed with error code 135
--再使用grid使用者生成ocm.rsp響應檔案,如下:
[grid@dbrac2 ~]$ /oracle/app/11.2.0/grid/OPatch/ocm/bin/emocmrsp
OCM Installation Response Generator 10.3.7.0.0 - Production
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit for details.
Email address/User Name:
You have not provided an email address for notification 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) was successfully created.
[grid@dbrac2 ~]$ ll
total 8
-rw-r--r-- 1 grid oinstall 621 May 15 23:02 ocm.rsp
[grid@dbrac2 ~]$
[grid@dbrac2 ~]$
--打補丁:
/oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/grid/ocm.rsp
[root@dbrac2 ~]# /oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/grid/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/11.2.0/grid -ocmrf /home/grid/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/opatchauto2018-05-15_23-04-01.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/opatchauto2018-05-15_23-04-01.report.log
2018-05-15 23:04:01: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/26609929 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/22502505 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.
[root@dbrac2 ~]#
--檢查:
[root@dbrac2 ~]# su - grid
[grid@dbrac2 ~]$ opatch lspatches
22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[grid@dbrac2 ~]$
--給ORACLE_HOME打補丁
/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
[root@dbrac2 27107360]# /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_22-15-50.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_22-15-50.report.log
2018-05-15 22:15:50: 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/dbhome_1 ...
Stopped RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
patch /tmp/27107360/26609929/custom/server/26609929 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
Starting RAC /oracle/app/oracle/product/11.2.0/dbhome_1 ...
Started RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
opatch auto succeeded.
[root@dbrac2 27107360]#
--檢查:
[root@dbrac2 27107360]# su - oracle
[oracle@dbrac2 ~]$ opatch lspatches
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[oracle@dbrac2 ~]$
五:更新dba_registry_history檢視資訊
--執行指令碼@?/rdbms/admin/catbundle.sql psu apply ,只在一個節點上執行
--跑指令碼前檢視:
SQL> select * from dba_registry_history;
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SER COMMENTS
----------------------------------- --------------- --------------- ---------- ---------- ---------- --------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
16-OCT-17 10.12.28.771351 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
07-MAR-18 06.07.41.694205 AM APPLY SERVER 11.2.0.4 161018 PSU PSU 11.2.0.4.161018
30-MAR-18 03.39.07.129649 PM APPLY SERVER 11.2.0.4 170718 PSU PSU 11.2.0.4.170718
SQL>
--跑指令碼@?/rdbms/admin/catbundle.sql psu apply
SQL> @?/rdbms/admin/prvtblin.plb
SQL> CREATE OR REPLACE PACKAGE BODY dbms_logrep_exp wrapped
2 a000000
3 1
4 abcd
5 abcd
6 abcd
7 abcd
8 abcd
省略...........................................
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/oracle/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_DBRAC_APPLY_2018May15_23_32_19.log
SQL>
--再次查詢:
SQL> select * from dba_registry_history;
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SER COMMENTS
----------------------------------- --------------- --------------- ---------- ---------- ---------- --------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
16-OCT-17 10.12.28.771351 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
07-MAR-18 06.07.41.694205 AM APPLY SERVER 11.2.0.4 161018 PSU PSU 11.2.0.4.161018
30-MAR-18 03.39.07.129649 PM APPLY SERVER 11.2.0.4 170718 PSU PSU 11.2.0.4.170718
15-MAY-18 11.32.57.424765 PM APPLY SERVER 11.2.0.4 180116 PSU PSU 11.2.0.4.180116
SQL>
環境說明:
[oracle@dbrac1 ~]$ cat /etc/issue
Red Hat Enterprise Linux Server release 6.7 (Santiago)
Kernel \r on an \m
[oracle@dbrac1 ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.2 dbrac1
192.168.56.3 dbrac1-vip
10.10.10.10 dbrac1-priv
192.168.56.4 dbrac2
192.168.56.5 dbrac2-vip
10.10.10.11 dbrac2-priv
192.168.56.8 rac-scan
[oracle@dbrac1 ~]$
要打的補丁為:p27107360_112040_Linux-x86-64.zip,opatch工具包:p6880880_112000_Linux-x86-64.zip
節點一二都把上述兩包放在/tmp下,且賦許可權為chmod 777 *.zip
[root@dbrac1 tmp]# ll *.zip
-rwxrwxrwx 1 root root 779304336 Apr 2 17:12 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 Mar 14 2016 p6880880_112000_Linux-x86-64.zip
[root@dbrac1 tmp]#
一:升級OPatch
下載最新的opatch程式並替換GI_HOME和ORACLE_HOME下的OPatch目錄
注意:rac1和rac2兩個節點的grid和oracle都要升級OPatch版本
[grid@dbrac1 ~]$ opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[grid@dbrac1 ~]$
[oracle@dbrac1 ~]$ opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
[oracle@dbrac1 ~]$
oracle使用者替換,備份之前的OPatch目錄:
[oracle@dbrac1 ~]$ cd $ORACLE_HOME
[oracle@dbrac1 dbhome_1]$
[oracle@dbrac1 dbhome_1]$ mv OPatch/ OPatch.bak
--解壓:
[oracle@dbrac1 tmp]$ unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME
Archive: p6880880_112000_Linux-x86-64.zip
creating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/
inflating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatchdiag
inflating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch.pl
creating: /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/jlib/
忽略..............................................................................
[oracle@dbrac1 dbhome_1]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[oracle@dbrac1 dbhome_1]$
grid使用者替換,備份之前的OPatch目錄:
[grid@dbrac1 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/11.2.0/grid
[grid@dbrac1 ~]$ exit
logout
[root@dbrac1 tmp]#
[root@dbrac1 tmp]# cd /oracle/app/11.2.0/grid
[root@dbrac1 grid]#
[root@dbrac1 grid]# mv OPatch/ OPatch.bak
[root@dbrac1 grid]#
[root@dbrac1 tmp]# cd /tmp
[root@dbrac1 tmp]# ll *.zip
-rwxrwxrwx 1 root root 779304336 Apr 2 17:12 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 Mar 14 2016 p6880880_112000_Linux-x86-64.zip
[root@dbrac1 tmp]# unzip p6880880_112000_Linux-x86-64.zip -d /oracle/app/11.2.0/grid
Archive: p6880880_112000_Linux-x86-64.zip
creating: /oracle/app/11.2.0/grid/OPatch/
inflating: /oracle/app/11.2.0/grid/OPatch/opatchdiag
inflating: /oracle/app/11.2.0/grid/OPatch/opatch.pl
creating: /oracle/app/11.2.0/grid/OPatch/jlib/
省略............................................................
[root@dbrac1 grid]#
[root@dbrac1 grid]# chown -R grid:oinstall OPatch/
[root@dbrac1 grid]#
[root@dbrac1 grid]# su - grid
[grid@dbrac1 ~]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[grid@dbrac1 ~]$
--節點2相同操作:
[root@dbrac2 tmp]# ll *.zip
-rwxrwxrwx 1 root root 779304336 May 15 09:45 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 May 15 09:45 p6880880_112000_Linux-x86-64.zip
[root@dbrac2 tmp]# su - oracle
[oracle@dbrac2 ~]$
[oracle@dbrac2 ~]$ cd $ORACLE_HOME
[oracle@dbrac2 dbhome_1]$ mv OPatch/ OPatch.bak
[oracle@dbrac2 dbhome_1]$
[oracle@dbrac2 dbhome_1]$ unzip /tmp/p6880880_112000_Linux-x86-64.zip
省略..........................................
[oracle@dbrac2 dbhome_1]$
[oracle@dbrac2 dbhome_1]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[oracle@dbrac2 dbhome_1]$
[root@dbrac2 ~]# su - grid
[grid@dbrac2 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/11.2.0/grid
[grid@dbrac2 ~]$
[grid@dbrac2 ~]$ exit
logout
[root@dbrac2 ~]# cd /tmp
[root@dbrac2 tmp]# cd /oracle/app/11.2.0/grid
[root@dbrac2 grid]# mv OPatch/ OPatch.bak
[root@dbrac2 grid]#
[root@dbrac2 grid]# unzip /tmp/p6880880_112000_Linux-x86-64.zip -d /oracle/app/11.2.0/grid
省略.................................
[root@dbrac2 grid]#
[root@dbrac2 grid]# chown grid:oinstall -R OPatch/
[root@dbrac2 grid]# su - grid
[grid@dbrac2 ~]$
[grid@dbrac2 ~]$ opatch version
OPatch Version: 11.2.0.3.12
OPatch succeeded.
[grid@dbrac2 ~]$
二:生成ocm檔案
在rac1和rac2分別生成ocm.rsp檔案。
su - oracle
$ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
[oracle@dbrac1 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
[oracle@dbrac1 ~]$
[oracle@dbrac1 ~]$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
The OCM configuration response file (/home/oracle/ocm.rsp) was successfully created.
[oracle@dbrac1 ~]$
[oracle@dbrac2 ~]$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
The OCM configuration response file (/home/oracle/ocm.rsp) was successfully created.
[oracle@dbrac2 ~]$ ll
total 4
-rw-r--r-- 1 oracle oinstall 623 May 15 20:15 ocm.rsp
[oracle@dbrac2 ~]$
三:給GRID_HOME安裝補丁
注意:雖然,opatch auto命令必須使用root使用者執行,但是其實還是需要透過root使用者su到grid和oracle使用者來執行相關的檢查工作。
--執行前先備份inventory_loc目錄和gird和oracle使用者的軟體目錄即家目錄:
[root@dbrac1 tmp]# cat /etc/oraInst.loc
inventory_loc=/oracle/app/oraInventory
inst_group=oinstall
[root@dbrac1 tmp]#
[root@dbrac1 tmp]# cat /etc/oratab
+ASM1:/oracle/app/11.2.0/grid:N # line added by Agent
dbrac:/oracle/app/oracle/product/11.2.0/dbhome_1:N # line added by Agent
[root@dbrac1 tmp]#
--再在打補丁前先檢查狀態:
[grid@dbrac1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.FRA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER_WANG.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.OCRVOTE.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.asm
ONLINE ONLINE dbrac1 Started
ONLINE ONLINE dbrac2 Started
ora.gsd
OFFLINE OFFLINE dbrac1
OFFLINE OFFLINE dbrac2
ora.net1.network
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.ons
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.registry.acfs
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dbrac2
ora.cvu
1 ONLINE ONLINE dbrac2
ora.dbrac.abcde.svc
1 ONLINE ONLINE dbrac2
ora.dbrac.db
1 ONLINE ONLINE dbrac2 Open
2 ONLINE ONLINE dbrac1 Open
ora.dbrac.dmmservice.svc
1 ONLINE ONLINE dbrac2
ora.dbrac1.vip
1 ONLINE ONLINE dbrac1
ora.dbrac2.vip
1 ONLINE ONLINE dbrac2
ora.oc4j
1 ONLINE ONLINE dbrac2
ora.scan1.vip
1 ONLINE ONLINE dbrac2
[grid@dbrac1 ~]$
--正式打補丁,先打節點一GI_HOME
[grid@dbrac1 ~]$ env|grep ORACLE_HOME
ORACLE_HOME=/oracle/app/11.2.0/grid
[grid@dbrac1 tmp]$ which opatch
/oracle/app/11.2.0/grid/OPatch/opatch
[grid@dbrac1 tmp]$
[grid@dbrac1 tmp]$ exit
logout
[root@dbrac1 grid]#
[root@dbrac1 grid]# cd /tmp
[root@dbrac1 tmp]# unzip p27107360_112040_Linux-x86-64.zip
省略....................................................................
[root@dbrac1 tmp]#chown oracle:oinstall -R 27107360/
[root@dbrac1 tmp]# ll
total 812916
drwxr-xr-x 5 oracle oinstall 4096 Dec 6 16:59 27107360
-rwxrwxrwx 1 root root 779304336 Apr 2 17:12 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 Mar 14 2016 p6880880_112000_Linux-x86-64.zip
[root@dbrac1 tmp]#
--grid下打補丁:
/oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/oracle/ocm.rsp
[root@dbrac1 tmp]# /oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/oracle/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/11.2.0/grid -ocmrf /home/oracle/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/opatchauto2018-05-15_17-26-36.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/opatchauto2018-05-15_17-26-36.report.log
2018-05-15 17:26:36: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/26609929 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/22502505 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.
[root@dbrac1 tmp]#
--在打補丁期間在節點2上查詢叢集狀態:發現打補丁時把節點1的db和crs停了;
[grid@dbrac2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dbrac2
ora.FRA.dg
ONLINE ONLINE dbrac2
ora.LISTENER.lsnr
ONLINE ONLINE dbrac2
ora.LISTENER_WANG.lsnr
ONLINE ONLINE dbrac2
ora.OCRVOTE.dg
ONLINE ONLINE dbrac2
ora.asm
ONLINE ONLINE dbrac2 Started
ora.gsd
OFFLINE OFFLINE dbrac2
ora.net1.network
ONLINE ONLINE dbrac2
ora.ons
ONLINE ONLINE dbrac2
ora.registry.acfs
ONLINE ONLINE dbrac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dbrac2
ora.cvu
1 ONLINE ONLINE dbrac2
ora.dbrac.abcde.svc
1 ONLINE ONLINE dbrac2
ora.dbrac.db
1 ONLINE ONLINE dbrac2 Open
2 ONLINE OFFLINE Instance Shutdown
ora.dbrac.dmmservice.svc
1 ONLINE ONLINE dbrac2
ora.dbrac1.vip
1 ONLINE INTERMEDIATE dbrac2 FAILED OVER
ora.dbrac2.vip
1 ONLINE ONLINE dbrac2
ora.oc4j
1 ONLINE ONLINE dbrac2
ora.scan1.vip
1 ONLINE ONLINE dbrac2
[grid@dbrac2 ~]$
--檢查
[root@dbrac1 tmp]# su - grid
[grid@dbrac1 ~]$
[grid@dbrac1 ~]$
[grid@dbrac1 ~]$ opatch lspatches
22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[grid@dbrac1 ~]$
三:給ORACLE_HOME安裝補丁
--給節點1的oracle使用者的ORACLE_HOME打補丁:
[oracle@dbrac1 ~]$ env|grep HOME
HOME=/home/oracle
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
[oracle@dbrac1 ~]$
[oracle@dbrac1 ~]$ exit
logout
[root@dbrac1 soft]#
--執行操作:
/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
[root@dbrac1 soft]# /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_17-56-39.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_17-56-39.report.log
2018-05-15 17:56:39: 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/dbhome_1 ...
Stopped RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
patch /tmp/27107360/26609929/custom/server/26609929 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
Starting RAC /oracle/app/oracle/product/11.2.0/dbhome_1 ...
Started RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
opatch auto succeeded.
[root@dbrac1 soft]#
[grid@dbrac2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.FRA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER_WANG.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.OCRVOTE.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.asm
ONLINE ONLINE dbrac1 Started
ONLINE ONLINE dbrac2 Started
ora.gsd
OFFLINE OFFLINE dbrac1
OFFLINE OFFLINE dbrac2
ora.net1.network
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.ons
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.registry.acfs
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dbrac2
ora.cvu
1 ONLINE ONLINE dbrac2
ora.dbrac.abcde.svc
1 ONLINE ONLINE dbrac2
ora.dbrac.db
1 ONLINE ONLINE dbrac2 Open
2 OFFLINE OFFLINE Instance Shutdown
ora.dbrac.dmmservice.svc
1 ONLINE ONLINE dbrac2
ora.dbrac1.vip
1 ONLINE ONLINE dbrac1
ora.dbrac2.vip
1 ONLINE ONLINE dbrac2
ora.oc4j
1 ONLINE ONLINE dbrac2
ora.scan1.vip
1 ONLINE ONLINE dbrac2
[grid@dbrac2 ~]$
--檢查:
[root@dbrac1 soft]# su - oracle
[oracle@dbrac1 ~]$ opatch lspatches
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[oracle@dbrac1 ~]$
四:給節點2的GI_HOME和ORACLE_HOME分別打補丁,步驟同二三步驟
[root@dbrac2 tmp]# ll
drwxr-xr-x 5 oracle oinstall 4096 Dec 6 16:59 27107360
-rwxrwxrwx 1 root root 779304336 May 15 09:45 p27107360_112040_Linux-x86-64.zip
-rwxrwxrwx 1 root root 52733900 May 15 09:45 p6880880_112000_Linux-x86-64.zip
[root@dbrac2 tmp]#
[root@dbrac2 tmp]#
--給GI_HOME打補丁:
用ORACLE使用者生成的ocm.rsp相應檔案報錯:Argument(s) Error... Given 'ocmrf' file does not exists. Please check the arguments and try again. OPatch failed with error code 135
--再使用grid使用者生成ocm.rsp響應檔案,如下:
[grid@dbrac2 ~]$ /oracle/app/11.2.0/grid/OPatch/ocm/bin/emocmrsp
OCM Installation Response Generator 10.3.7.0.0 - Production
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit for details.
Email address/User Name:
You have not provided an email address for notification 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) was successfully created.
[grid@dbrac2 ~]$ ll
total 8
-rw-r--r-- 1 grid oinstall 621 May 15 23:02 ocm.rsp
[grid@dbrac2 ~]$
[grid@dbrac2 ~]$
--打補丁:
/oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/grid/ocm.rsp
[root@dbrac2 ~]# /oracle/app/11.2.0/grid/OPatch/opatch auto /tmp/27107360/ -oh /oracle/app/11.2.0/grid -ocmrf /home/grid/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/11.2.0/grid -ocmrf /home/grid/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/opatchauto2018-05-15_23-04-01.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/opatchauto2018-05-15_23-04-01.report.log
2018-05-15 23:04:01: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/26609929 apply successful for home /oracle/app/11.2.0/grid
patch /tmp/27107360/22502505 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.
[root@dbrac2 ~]#
--檢查:
[root@dbrac2 ~]# su - grid
[grid@dbrac2 ~]$ opatch lspatches
22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[grid@dbrac2 ~]$
--給ORACLE_HOME打補丁
/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
[root@dbrac2 27107360]# /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /tmp/27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 27107360 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /home/oracle/ocm.rsp -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_22-15-50.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2018-05-15_22-15-50.report.log
2018-05-15 22:15:50: 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/dbhome_1 ...
Stopped RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
patch /tmp/27107360/26925576 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
patch /tmp/27107360/26609929/custom/server/26609929 apply successful for home /oracle/app/oracle/product/11.2.0/dbhome_1
Starting RAC /oracle/app/oracle/product/11.2.0/dbhome_1 ...
Started RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully
opatch auto succeeded.
[root@dbrac2 27107360]#
--檢查:
[root@dbrac2 27107360]# su - oracle
[oracle@dbrac2 ~]$ opatch lspatches
26609929;OCW Patch Set Update : 11.2.0.4.170814 (26609929)
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[oracle@dbrac2 ~]$
五:更新dba_registry_history檢視資訊
--執行指令碼@?/rdbms/admin/catbundle.sql psu apply ,只在一個節點上執行
--跑指令碼前檢視:
SQL> select * from dba_registry_history;
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SER COMMENTS
----------------------------------- --------------- --------------- ---------- ---------- ---------- --------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
16-OCT-17 10.12.28.771351 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
07-MAR-18 06.07.41.694205 AM APPLY SERVER 11.2.0.4 161018 PSU PSU 11.2.0.4.161018
30-MAR-18 03.39.07.129649 PM APPLY SERVER 11.2.0.4 170718 PSU PSU 11.2.0.4.170718
SQL>
--跑指令碼@?/rdbms/admin/catbundle.sql psu apply
SQL> @?/rdbms/admin/prvtblin.plb
SQL> CREATE OR REPLACE PACKAGE BODY dbms_logrep_exp wrapped
2 a000000
3 1
4 abcd
5 abcd
6 abcd
7 abcd
8 abcd
省略...........................................
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/oracle/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_DBRAC_APPLY_2018May15_23_32_19.log
SQL>
--再次查詢:
SQL> select * from dba_registry_history;
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SER COMMENTS
----------------------------------- --------------- --------------- ---------- ---------- ---------- --------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
16-OCT-17 10.12.28.771351 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
07-MAR-18 06.07.41.694205 AM APPLY SERVER 11.2.0.4 161018 PSU PSU 11.2.0.4.161018
30-MAR-18 03.39.07.129649 PM APPLY SERVER 11.2.0.4 170718 PSU PSU 11.2.0.4.170718
15-MAY-18 11.32.57.424765 PM APPLY SERVER 11.2.0.4 180116 PSU PSU 11.2.0.4.180116
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2154539/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11g RAC自動打GI PSU補丁Oracle
- GI PSU滾動方式應用GI HOME和DB HOME(opatch auto together)
- 【PSU】怎麼給RAC打PSU補丁
- OJVM+GI PSU補丁升級JVM
- 19c 自動打RU補丁
- 19c rac自動打補丁步驟
- ORACLE opatch 打補丁fuser command output for /u01/.../crsctl.bin is FailureOracleAI
- ORACLE打補丁的方法和案例Oracle
- ORACLE RAC的全自動 打補丁標準化文件Oracle
- oracle打補丁回顧Oracle
- 如何給esxi打補丁
- Linux檔案打補丁Linux
- $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithOracleAI
- DG環境下打補丁
- weblogic的版本及打補丁Web
- Oracle的OPatch補丁更新Oracle
- Git 打補丁– patch 和 diff 的使用(詳細)Git
- Git 打補丁-- patch 和 diff 的使用(詳細)Git
- Oracle RAC 19.3打19.5.1 RU補丁Oracle
- windows oracle 11201打補丁報錯WindowsOracle
- [202021127]sql打補丁問題.txtSQL
- 打補丁時重建Inventory目錄
- 關於oracle opatch打補丁是 不能用grid使用者直接mvOPatch folder的問題Oracle
- 12C打psu
- Oracle Goldengate 12c打pus補丁OracleGo
- 打補丁打出新的BUG來了
- 補丁psu、spu、cpu的意思
- oracle rac 打PSU補丁30805461兩個問題(Java版本及空間不足導致失敗)OracleJava
- 【PSU】Oracle打PSU及解除安裝PSU(單例項)Oracle單例
- SAP打補丁時需要注意的地方
- Android熱補丁之Robust(二)自動化補丁原理解析Android
- [20210929]sql打補丁使用rule提示問題.txtSQL
- [20220329]19c sql語句打補丁.txtSQL
- [20220330]編寫sql打補丁的指令碼.txtSQL指令碼
- weblogic10.3.6軟體打補丁很慢問題Web
- 【UP_ORACLE】如何給Oracle DG打補丁(二)備庫安裝補丁步驟Oracle
- 【UP_ORACLE】如何給Oracle DG打補丁(三)主庫安裝補丁步驟Oracle
- oracle 19c rac打補丁常見錯誤Oracle