Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
In this article, I’ll guide you through updating the OPatch utility and performing a pre-check to ensure smooth patch application in Oracle 19c. We will be using the OPatch utility located in /u01/patch/patch_1924
to update to PSU 19.24.
First, download the latest OPatch patch set (PSU 19.24 in this case) from Oracle Support and place it in the directory /u01/patch/patch_1924
.
To make sure the patch files have the correct permissions, run:
# As root
chmod 777 -R /u01/patch/patch_1924
Warning: Be cautious when setting permissions recursively to 777. Only apply this to the specific patch directory.
grid
UserNext, switch to the grid
user, who will handle the OPatch update:
su - grid
Navigate to the patch directory:
cd /u01/patch/patch_1924
Inside the patch directory, unzip the OPatch archive:
unzip -q p6880880_190000_Linux-x86-64.zip
This creates a new OPatch
folder with the updated utility files.
Oracle installations have an OPatch
directory within $ORACLE_HOME
. Our update process involves backing up the current OPatch directory and replacing it with the new version.
Navigate to your existing OPatch directory:
cd $ORACLE_HOME/OPatch
pwd
# Output should confirm your ORACLE_HOME OPatch directory, e.g., /u01/app/oracle/product/19.0.0/grid/OPatch
OPatch
, moving the old files there. If a folder named old
already exists, consider renaming it or creating old2
: mkdir old
mv * old/
/u01/patch/patch_1924/OPatch
to the $ORACLE_HOME/OPatch
directory: cp -ra /u01/patch/patch_1924/OPatch/* ./
To confirm the OPatch update was successful, check the version:
./opatch version
Example Output:
OPatch Version: 12.2.0.1.44 OPatch succeeded.
Now, it’s time to unpack the actual patches and run the pre-check.
Go back to the patch directory:
cd /u01/patch/patch_1924
unzip -q p36582629_190000_Linux-x86-64.zip
Verify the new patch folder (36582629
) was created:
ll -h
Use the following command to check for conflicts in the patch:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/patch_1924/36582629/36582781 | tail -n5
Repeat this for each patch in the directory:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/patch_1924/36582629/36587798 | tail -n5
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/patch_1924/36582629/36590554 | tail -n5
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/patch_1924/36582629/36648174 | tail -n5
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/patch_1924/36582629/36758186 | tail -n5
Each command should return “OPatch succeeded” to confirm no conflicts.
Switch to the root user and export the necessary environment variables:
su - root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/u01/app/oracle/product/19.0.0/grid/bin:/u01/app/oracle/product/19.0.0/grid/OPatch; export PATH
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_HOSTNAME=L17Oracle02; export ORACLE_HOSTNAME
LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/grid/lib; export LD_LIBRARY_PATH
OH=/u01/app/oracle/product/19.0.0/grid; export OH
ORACLE_HOME=/u01/app/oracle/product/19.0.0/grid; export ORACLE_HOME
Change to the main patch directory and run the pre-check with the -analyze
option, ensuring the patch is tested without applying it permanently:
cd /u01/patch/patch_1924/36582629
$ORACLE_HOME/OPatch/opatchauto apply /u01/patch/patch_1924/36582629 -oh /u01/app/oracle/product/19.0.0/grid -analyze
Expected Output:
OPatchAuto session is initiated... Patch applicability verified successfully on home... OPatchAuto successful.
Your OPatch utility is now updated, and you have successfully run pre-checks to ensure a smooth patching process in Oracle 19c. By following these steps, you minimize downtime and reduce the risk of errors during patching.