In this article I will explain how to install/upgrade OPatch utility in grid_home and oracle_home in a RAC infrastructure.

Opatch utility is used while applying patches to the database. Every readme file (that comes with patch), mention the recommended opatch version. If your existing opatch version is lower than the recommended version then, Opatch need to be updated.

Here we will upgrade Opatch on both GRID_HOME and DB_HOME in a 2 node RAC setup.

 

 

How to check your existing opatch version:

 

cd $GRID_HOME/OPatch
/gridapp/app/oracle/product/grid12c/OPatch# ./opatch version
OPatch Version: 12.2.0.1.14
 
OPatch succeeded.

cd $ORACLE_HOME/OPatch
/oracle/app/oracle/product/12.1.0.2/dbhome_1/OPatch#./opatch version
OPatch Version: 12.2.0.1.14
 
OPatch succeeded.



Lets proceed with install/upgrade OPatch.

1. Download latest opatch utility

LINK –  > Oracle OPatch link – 6880880

 

 

select required release and platform for download.

 

2. Copy the file to both the database nodes:

 

cd /dumparea
ls -ltr p6880880_122001_Solaris.zip

3. Upgrade OPatch on GRID_HOME( as root user)

----Backup existing OPatch ( as root user)

root#cd $GRID_HOME
root#pwd
/gridapp/app/oracle/product/grid12c

root#cp OPatch OPatch_old

--- copy the latest opatch file to GRID_HOME and unzip 
root#cp /dumparea/p6880880_122001_Solaris.zip /gridapp/app/oracle/product/grid12c/

root# cd /gridapp/app/oracle/product/grid12c/
root# unzip p6880880_122001_Solaris.zip

-- provide permission to grid owner( this is very important)

root# chown -R oracle:oinstall OPatch
root#chmod -R 755 OPatch

-- Check the OPatch version
root#./opatch version
OPatch Version: 12.2.0.1.21

GRID_HOME OPatch has been upgraded. Lets proceed with DB_HOME

4. Upgrade OPatch in DB_HOME

oracle$cd $ORACLE_HOME

oracle$pwd
/oracle/app/oracle/product/12.1.0.2/dbhome_1

oracle$cp OPatch OPatch_old

--- copy the latest opatch file to DB_HOME and unzip
oracle$cp /dumparea/p6880880_122001_Solaris.zip /oracle/app/oracle/product/12.1.0.2/dbhome_1

oracle$ cd /oracle/app/oracle/product/12.1.0.2/dbhome_1
oracle$ unzip p6880880_122001_Solaris.zip

-- Check the OPatch version
oracle$./opatch version
OPatch Version: 12.2.0.1.21

Now DB_HOME opatch version has been upgrade on the node 1:

THESE SAME OPATCH UPGRADE NEED TO BE FOLLOWED ON OTHER NODES IN THE GRID ALSO.