Installing and Applying Oracle Patches
First, carefully read the patch’s README and prepare the DB for applying the patch. If unable to prepare the database please refer to Oracle Support SR.
To update OPatch, Oracle’s patch applying utility:
OPatch – Where Can I Find the Latest Version of OPatch? [Video] (Doc ID 224346.1)
To download the patch directly: log on to support.oracle.com –> using the “patches & updates” link, download patch 6880880 appropriate to the operating system.
Updating the OPatch application.
rdbms_home
Download file: p6880880_112000_Solaris86-64.zip and saved to /SetUp/oracle/patches
1 2 3 4 5 6 7 8 9 |
cd /SetUp/oracle/patches unzip p6880880_112000_Solaris86-64.zip Granting privileges to the oracle user chown -R oracle:oinstall /SetUp/oracle/patches/OPatch cd /u01/app/oracle/product/11.2.0/db_1/OPatch |
Making a backup of the old version to the old directory
1 2 3 |
mkdir old mv crs docs emdpatch.pl fmw jlib ocm opatch opatch.ini opatch.pl opatchprereqs old |
Copying the new version
1 |
cp -r /SetUp/oracle/patches/OPatch/* /u01/app/oracle/product/11.2.0/db_1/OPatch |
1 2 3 4 5 |
To check export PATH=$PATH:/u01/app/oracle/product/11.2.0/db_1/OPatch $ opatch lsinventory |
grid_home
This is after having downloaded and extracted p6880880_112000_Solaris86-64.zip in the /SetUp/oracle/patches folder.
Using root
1 2 3 4 5 6 7 8 9 10 11 12 13 |
cd /SetUp/oracle/patches Granting priviliges to the grid user (the owner of grid_home) chown -R grid:oinstall /SetUp/oracle/patches/OPatch cd /u01/11.2.0/grid/OPatch/ mkdir old mv crs docs emdpatch.pl fmw jlib ocm opatch opatch.ini opatch.pl opatchprereqs old cp -r /SetUp/oracle/patches/OPatch/* /u01/11.2.0/grid/OPatch/ |
To check
1 2 3 |
export PATH=$PATH:/u01/11.2.0/grid/OPatch $ opatch lsinventory |
Defining the path where the shell script can run “opatch”
1 2 3 4 5 6 7 |
for the rdbms export PATH=$PATH:/u01/app/oracle/product/11.2.0/db_1/OPatch for the grid export PATH=$PATH:/u01/11.2.0/grid/OPatch |
Online patch install
1 2 3 4 5 6 7 |
cd /SetUp/patches/OdeaBank_Patch/11063191 opatch apply online -connectString mx1:oracle:0racle:dbk01,mx2:oracle:0racle:dbk02 deinstall/rollback opatch rollback -id 11063191 -connectString mx1:oracle:0racle:dbk01,mx2:oracle:0racle:dbk02 |
Note:
1. opatch apply online -connectString
SID_NAME_1:rdbms_home_owner:password:node_name,SID_NAME_2:rdbms_home_owner:password:node_name
2. As an online rollback wasn’t applied a hyphen character ‘–‘ could cause issues.
If its necessary to create pcm.rsp
As a the grid home owner, which is grid
1 2 3 4 5 |
export PATH=$PATH:/usr/ccs/bin export PATH=$PATH:/u01/11.2.0/grid/OPatch $ORACLE_HOME/OPatch/ocm/bin/emocmrsp |
alternatively
1 |
$ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /SetUp/Grid_11.2.0.3.5/ocm.rsp |
As the root user
1 2 3 4 5 6 7 8 9 |
examples opatch auto /SetUp/patch/grid -ocmrf /home/oracle/ocm.rsp opatch auto /SetUp/Patch/grid/14275605 -oh /u01/11.2.0/grid -ocmrf /home/grid/ocm.rsp opatch auto /SetUp/patch/grid/ -oh /u01/app/oracle/product/11.2.0/db_1 -ocmrf /home/oracle/ocm.rsp opatch lsinventory -detail -oh /u01/11.2.0/grid/ |
A patch has been applied to both grid home and rdbms home
Details
1 |
patch lsinventory -detail -oh /u01/app/oracle/product/11.2.0/db_1 |
Varieties
1 2 3 |
opatch napply -local -oh /u01/11.2.0/grid -id 9974223 opatch prereq CheckConflictAgainstOHWithDetail -ph ./ |
Following executables are active
1 2 3 |
/u01/11.2.0/grid/lib/libclntsh.so.11.1 crsctl stop has |
Flow diagrams
All-Node Patch
- Shutdown all Oracle instances on all nodes
- Apply the patch to the RAC home on all nodes
- Bring all instances up
Minimum downtime
- Shutdown the Oracle instance on node 1
- Apply the patch to the RAC home on node 1
- Shutdown the Oracle instance on node 2
- Apply the patch to the RAC home on node 2
- Shutdown the Oracle instance on node 3
- At this point, instances on nodes 1 and 2 can be brought up
- Apply the patch to the RAC home on node 3
- Startup the Oracle instance on node 3
Rolling patch (no downtime)
- Shutdown the Oracle instance on node 1
- Apply the patch to the RAC home on node 1
- Start the Oracle instance on node 1
- Shutdown the Oracle instance on node 2
- Apply the patch to the RAC home on node 2
- Start the Oracle instance on node 2
- Shutdown the Oracle instance on node 3
- Apply the patch to the RAC home on node 3
- Start the Oracle instance on node 3