Step by Step OPatch upgrade in Oracle
Step by Step Utility “OPatch” Upgrade along with Latest Download Binary in Oracle
I was applying the October patch on my 12.2.0.1 Oracle home and it got failed with the below error in prechecks due to the version of utility “OPatch” didn’t meet to minimum required version as per Oracle recommendations. So always recommended going through read me a document of specific patch ID before patch applies to eliminate any roadblock in activities.
Below is the error while performing conflict for patch id 31741641 October 2020 patch.
$ ./opatch prereq CheckConflictAgainstOHWithDetail -ph ./ Oracle Interim Patch Installer version 12.2.0.1.6 Copyright (c) 2020, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/oracle/product/12.2.0.1/db_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/12.2.0.1/db_1/oraInst.loc OPatch version : 12.2.0.1.6 OUI version : 12.2.0.1.4 Log file location : /u01/app/oracle/product/12.2.0.1/db_1/cfgtoollogs/opatch/opatch2020-10-31_02-31-00AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" is not executed. The details are: Unable to create Patch Object. Exception occured : PatchObject constructor: Input file "/u01/app/oracle/product/12.2.0.1/db_1/OPatch_22102020/auto/etc/config/actions" or "/u01/app/oracle/product/12.2.0.1/db_1/OPatch_22102020/auto/etc/config/inventory" does not exist. OPatch failed with error code 2
Utility “OPatch” Upgrade Demonstration
Below are step-by-step demonstration on utility “OPatch“ upgrade and the minimum version is require 12.2.0.1.21 so we will upgrade here the most latest version of utility “OPatch“.
Step-1: In this step, we will download most latest “OPatch” version 6880880 from My Oracle Support. While downloading “OPatch” make sure to select the correct version & OS platform then click on the download button. Below is a sample screenshot.
Step-2: Move the downloaded patch binary to the desired server where it’s required to upgrade “OPatch” version.
[oracle@DBsGuru-lab1 ~]$ cd /oradata/12.2.0.1_patch_oct2020 [oracle@DBsGuru-lab1 ~]$ ls p6880880_122010_Linux-x86-64.zip
Step-3: We will take a backup of the existing utility “OPatch” as a rollback plan in case of any misshapen during the upgrade.
[oracle@DBsGuru-lab1 ~]$ . oraenv ORACLE_SID = [labdb02] ? labdb01 The Oracle base remains unchanged with value /u01/app/oracle [oracle@DBsGuru-lab1 ~]$ cp -R $ORACLE_HOME/OPatch -R $ORACLE_HOME/OPatch_01Nov20.bkp [oracle@DBsGuru-lab1 ~]$ ls -ld $ORACLE_HOME/OPatch* drwxrwxr-x 10 oracle oinstall 4096 Sep 25 2016 /u01/app/oracle/product/12.1.0/db_1/OPatch drwxr-xr-x 10 oracle oinstall 4096 Nov 1 13:59 /u01/app/oracle/product/12.1.0/db_1/OPatch_01Nov20.bkp OR alternatively, follow the below command. [oracle@DBsGuru-lab1 ~]$ cd $ORACLE_HOME [oracle@DBsGuru-lab1 db_1]$ pwd /u01/app/oracle/product/12.2.0.1/db_1 [oracle@DBsGuru-lab1-lab1 db_1]$ cp -R OPatch -R OPatch_01Nov20.bkp [oracle@DBsGuru-lab1 db_1]$ ls -ld OPatch* drwxrwxr-x 10 oracle oinstall 4096 Sep 25 2016 OPatch drwxr-xr-x 11 oracle oinstall 4096 Nov 1 14:04 OPatch_01Nov20.bkp
Step-4: In this step, we will upgrade utility “OPatch” followed by the below commands.
[oracle@DBsGuru-lab1 ~]$ . oraenv ORACLE_SID = [labdb02] ? labdb01 The Oracle base remains unchanged with value /u01/app/oracle [oracle@DBsGuru-lab1 ~]$ cd /oradata/12.2.0.1_patch_oct2020 [oracle@DBsGuru-lab1 12.2.0.1_patch_oct2020]$ unzip p6880880_122010_Linux-x86-64.zip -d /u01/app/oracle/product/12.2.0.1/db_1/ OR alternatively, follow the below command. [oracle@DBsGuru-lab1 12.2.0.1_patch_oct2020]$ unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME Archive: p6880880_122010_Linux-x86-64.zip replace /u01/app/oracle/product/12.2.0.1/db_1/OPatch/emdpatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: A inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/emdpatch.pl inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/oracle_common/modules/com.oracle.glcm.common-logging_1.6.5.0.jar inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/oplan/oplan inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/datapatch inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/docs/FAQ inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/docs/Prereq_Users_Guide.txt inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/docs/cversion.txt inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/docs/Users_Guide.txt extracting: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/ocm/generic.zip inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/README.txt inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/jlib/oracle.opatch.classpath.windows.jar inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/jlib/opatchsdk.jar inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/jlib/oracle.opatchcore.classpath.windows.jar inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/jlib/oracle.opatch.classpath.jar inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/jlib/oracle.opatch.classpath.unix.jar inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/jlib/oracle.opatchcore.classpath.jar inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/jlib/glcm_tools.jar ----------------------------------------------- -----------------Trimmed data------------------ ----------------------------------------------- inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/auto/dbsessioninfo/README.txt inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/opatch_env.sh inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/opatchauto inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/operr inflating: /u01/app/oracle/product/12.2.0.1/db_1/OPatch/opatchauto.cmd
NOTE: In the above command line number 14, we used option “A(ll)” while unzipping since we have taken a backup of utility “OPatch” in the same location in Step-3.
Step-5: Now we are in the final stage to validate the version of utility “OPatch” after an upgrade and we are all set to perform applying the patches.
[oracle@DBsGuru-lab1 ~]$ . oraenv ORACLE_SID = [labdb02] ? labdb01 The Oracle base remains unchanged with value /u01/app/oracle [oracle@DBsGuru-lab1 ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH [oracle@DBsGuru-lab1 ~]$ opatch version OPatch Version: 12.2.0.1.21 [oracle@DBsGuru-lab1 ~]$ cat $ORACLE_HOME/OPatch/version.txt OPATCH_VERSION:12.2.0.1.21 OR alternatively, follow the below command. [oracle@DBsGuru-lab1 ~]$ cd $ORACLE_HOME/OPatch [oracle@DBsGuru-lab1 OPatch ~]$ ./opatch version OPatch Version: 12.2.0.1.21 [oracle@DBsGuru-lab1 OPatch ~]$ cat version.txt OPATCH_VERSION:12.2.0.1.21
Click here for Step by Step Apply Patch on Oracle DB Home.
Click here to get all in one Oracle Critical Database Patch IDs for October 2020
This document is only for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.
Hope so you like this article!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our pursuit.
1,270 total views, 1 views today
Hello and welcome to DBsGuru,
DBsGuru is a group of experienced DBA professionals and serves databases and its related community by providing technical blogs, projects, training.
Technical blogs are the source of vast information not about databases but its related product like middleware, PL/SQL, replication methodology, and so on.
Thanks for the visits!
Share Learn Grow!