oracledba.help

OPatch, Updating

<- Install

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.

These examples use OPatch 12.2.0.1.17.

Prerequisites

  • Determine your version:
    $ORACLE_HOME/OPatch/opatch lsinventory
  • Get the latest OPatch here.
    • Select a Release that matches your database version.
    • Per Oracle (3-18615460221), for 12.1.0.2 select "Oracle 12.1.0.1.0".

Make sure to download the right version (x86-64).
The download site sometimes defaults to the 32-bit version!

Copy to System

 su - oracle
 mkdir -p /u01/orasw/patches/OPatch/12.2.0.1.17
 cd /media/sf_sw/Oracle/OPatch/Latest
 cp p6880880_121010_Linux-x86-64.zip /u01/orasw/patches/OPatch/12.2.0.1.17/
 cd /u01/orasw/patches/OPatch/12.2.0.1.17
 ls -l

In this example Opatch was downloaded to /media/sf_sw/Oracle/OPatch/Latest.

Update

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


 If RAC Used - Perform These Steps Next
 su -
 cd /u01/app/12.1.0.2/grid
 mv OPatch zOPatch_$(date "+%Y%m%d%H%M")
 mkdir OPatch
 chown grid:oinstall OPatch

 cp /u01/orasw/patches/OPatch/12.2.0.1.17/p6880880_121010_Linux-x86-64.zip
    /u01/app/12.1.0.2/grid/
 chown grid:oinstall /u01/app/12.1.0.2/grid/p6880880_121010_Linux-x86-64.zip

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

For Oracle-Restart 12.1 go here.

Confirm Version

Run for each user\home (grid, oracle).
$ORACLE_HOME/OPatch/opatch lsinventory|more

 Oracle Interim Patch Installer version 12.2.0.1.17
 Copyright (c) 2018, Oracle Corporation.  All rights reserved. 

 Oracle Home       : /u01/app/oracle/product/12.1.0.2/dbhome_1
 Central Inventory : /u01/app/oraInventory
    from           : /u01/app/oracle/product/12.1.0.2/dbhome_1/oraInst.loc
 OPatch version    : 12.2.0.1.17
 OUI version       : 12.1.0.2.0

Oracle-Restart

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

 cp /u01/orasw/patches/OPatch/12.2.0.1.17/p6880880_121010_Linux-x86-64.zip 
    /u01/app/grid/product/12.1.0.2/grid/
 chown grid:oinstall /u01/app/grid/product/12.1.0.2/grid/p6880880_121010_Linux-x86-64.zip

 su - grid
 cd $ORACLE_HOME
 unzip p6880880_121010_Linux-x86-64.zip

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