[Oracle] How to patch a Database Oracle Home
ENVIRONMENT:
- Red Hat Linux 7
- Oracle Database 12
VARIABLES:
- MYPATCH: patch to install
- MYPATCHDIR: directory where the unzipped patch is located
Hi all,
in this tutorial we are going to apply a patch to an existing Database Oracle Home.
First of all, unzip the patch:
unzip MYPATCH -d MYPATCHDIR
Next, just check for conflicts with already installed patches:
cd MYPATCHDIR/MYPATCH
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
Prereq "checkConflictAgainstOHWithDetail" passed.
This is the output when no conflicts are present. If there are conflicts, contact Oracle Support to request a Merge Patch.
Next, stop all the database instances running in that Oracle Home:
srvctl stop home -o $ORACLE_HOME -s /tmp/stop.txt
And then install the patch:
cd MYPATCHDIR/MYPATCH
$ORACLE_HOME/OPatch/opatch apply ./ -local
Once finished, restart all database instances previously stopped:
srvctl start home -o $ORACLE_HOME -s /tmp/stop.txt
And check if the patch is correctly installed:
$ORACLE_HOME/OPatch/opatch lspatches
MYPATCH...
Optionally, some patches may require to run datapatch utility on all databases after installing the patch. Just launch the following command for every database instance on the patched Oracle Home:
$ORACLE_HOME/OPatch/datapatch --verbose
That’s all, see you in the next tutorial!