oracledba.help
Install

OPatch, Updating

Overview

The following covers updating OPatch to the latest version. For RAC environments you must update OPatch in both the oracle user and grid user homes on all nodes. 12c Session here.

Prerequisites

  • Determine your version:
    $ORACLE_HOME/OPatch/opatch lsinventory
  • Get the latest OPatch here.
    • Select a Release that matches your database version.
    • Example:
      • OPatch 12.2.0.1.46 for DB 19.0.0.0.0 (Mon YYYY)
      • Opatch 19.0.0.0.0
      • Linux x86-64

19c Session

Copy to System

 su -
 cp p6880880_190000_Linux-x86-64.zip /u01/orasw/patches/OPatch/
 cd /u01/orasw/patches/OPatch
 chown oracle:oinstall p6880880_190000_Linux-x86-64.zip

If RAC, perform above on all nodes.

Update

 su - oracle
 mv $ORACLE_HOME/OPatch $ORACLE_HOME/zOPatch_$(date "+%Y%m%d%H%M")
 cd /u01/orasw/patches/OPatch
 cp p6880880_190000_Linux-x86-64.zip $ORACLE_HOME/
 cd $ORACLE_HOME
 unzip p6880880_190000_Linux-x86-64.zip
 $ORACLE_HOME/OPatch/opatch lsinventory|more

 Oracle Interim Patch Installer version 12.2.0.1.46
 ...
 OPatch version    : 12.2.0.1.46

If RAC, perform above on all nodes.

If RAC - Perform These Steps

 su -
 export GRID_HOME=/u01/app/19.3.0.0.0/grid
 cd $GRID_HOME
 mv OPatch zOPatch_$(date "+%Y%m%d%H%M")
 mkdir OPatch
 chown grid:oinstall OPatch

 export OP_DIR=/u01/orasw/patches/OPatch/latest
 cp $OP_DIR/p6880880_190000_Linux-x86-64.zip $GRID_HOME/
 chown grid:oinstall $GRID_HOME/p6880880_190000_Linux-x86-64.zip

 su - grid
 cd $ORACLE_HOME
 unzip p6880880_190000_Linux-x86-64.zip
 $ORACLE_HOME/OPatch/opatch lsinventory|more

If RAC, perform above on all nodes.


Common Errors

OPatch cannot continue because it would not be able to load OUI...

$ORACLE_HOME/OPatch/opatch lsinventory

OPatch cannot continue because it would not be able to load OUI platform dependent library 
from the directory "/u01/app/12.1.0.2/grid/oui/lib/linux". The directory does not exist in 
the Oracle home.

This could be due to the following reasons.
(1) Incompatible usage of java with OUI (32/64 bit).
(2) Wrong 32-bit Oracle Home installation in 64-bit environment (or) vice-versa.
Please contact Oracle support for more details.

OPatch failed with error code 1

Solution

You probably downloaded the wrong version. Make sure to get the 64-bit version.

Wrong Version

 Linux x86

Correct Version

 Linux x86-x64

Example file: p6880880_121010_Linux-x86-64.zip

Reference

  • 274526.1