Section 2.3.2, "Patching a Fusion Middleware Product"
Quoting: "Once you obtain the patch, determine the Oracle home directory to which you are going to apply the patch....If you do not know the name of your Oracle home, you should run the opatch lshomes command as described in Section 2.4.6, "Listing the Applicable Oracle Homes for a Patch" to obtain a list of Oracle homes that pertain to the domain."
So let's see, I've got two OPATCH.BAT files, one in c:\mw_home1\Oracle_BI1=OPatch\, and the other in c:\mw_home1\oracle_common\OPatch\.
I open a command window, CD to one of those paths, and run opatch lshomes. I get this error:
"The Oracle Home C:\mw_home1 is not OUI based home. Please give proper Oracle Home. OPatch returns with error code = 1. OPatch failed with error code = 1"
Same results for the other opatch.bat in the other directory.
Besides the atrocious grammar, this error message is not helpful in the least. I'm trying to patch OBIEE 11g, which is installed in c:\mw_home1. What else is opatch wanting?
Please run this command in a DOS window: "set ORACLE_HOME=E:\Oracle\Middleware\Oracle_BI"
This changes your Oracle Home to you BI installation folder. Change the above mentioned path according to your installation. To see if this worked run the following command in the Opatch folder: "opatch version"
Yes, the error message is misleading. It should say something like "Environment variable ORALCE_HOME has not been set or set incorrectly".
Here is how I solved the problem on a Windows Oracle Fusion Middleware SOA installation. The SOA installation already comes with OPatch installed. In my case it is located in D:\Oracle\Middleware\Oracle_SOA1\OPatch. On a command prompt, I set the environment variable ORACLE_HOME like this
and the CLASSPATH variable like this
The latter prevents opatch from loading classes it does not need and throwing java.lang.ClassNotFoundException. Also notice ORACLE_HOME does not point to D:\Oracle\Middleware but D:\Oracle\Middleware\Oracle_SOA1. I made a mistake by setting ORACLE_HOME to D:\Oracle\Middleware kept getting:
"Recommended actions: Please make sure no other OPatch or OUI processes is running. Try to run $ORACLE_HOME/oui/bin/runInstsaller.
OPatch failed with error code = 20"
I wasted a lot of time trying to figure out what went wrong.