OPATCH_JAVA_ERROR : An exception of type “OPatchException” has occurred

Posted on November 4, 2008. Filed under: Apps Technology Stack, Database, DBA/Admin Tips, opatch, Patch, R12, TroubleShooting | Tags: , , |

While trying to apply a patch or listing inventory, using opatch utility (be it on the Database node or for the Applications Tech Stack) below error is encountered:

LsInventory: OPatch Exception while accessing O2O

OPATCH_JAVA_ERROR  : An exception of type “OPatchException” has occurred:
OPatch Exception:
OUI found no such ORACLE_HOME set in the environment
Can not get details for given Oracle Home
An exception occurs

There is no Interim Patch

OPATCH_JAVA_ERROR  : An exception of type “OPatchException” has occurred:
Can not get a list of inventory on this home.

ERROR: OPatch failed because of Inventory problem.


Imagine you are trying to apply a patch to 10.1.3 Tech Stack Oracle Home on R12.

What did i do wrong ?

1. Did i source the corrent environment file ?

Yes, i did, my echo $ORACLE_HOME command points to 10.1.3 home instead of the default 10.1.2 home. hmmm ok

2. Am i using the correct opatch utility?

yes, which opatch is pointing to $ORACLE_HOME(10.1.3)/Opatch/opatch

3. Is the inventory location accessible ?

Yes, oraInst.loc under Oracle Home (10.1.3) is pointing to a valid directory.

$ cat oraInst.loc

4. Does the inventory has information about the Oracle Home you are trying to patch?

How do i check that ….

$ cd /var/opt/oracle/oraInventory

$ ls -latr
total 112
drwxrwxr-x   3 username    dba  ..
drwxrwxr-x   2 username    dba  oui
-rwxrwxr-x   1 username    dba  sessionContext.ser
drwxrwxr-x   2 username    dba  ContentsXML
-rwxrwxr-x   1 username    dba
drwxrwxr-x   2 username    dba  Contents
drwxrwx—   3 username    dba  logs
-rwxrwxr-x   1 username    dba  install.platform
drwxrwxr-x   6 username    dba  .

$ cd ContentsXML
$ vi inventory.xml

<HOME NAME=”SID_TOOLS__masked_oracle_home_tech_st_10_1_2″ LOC=”[masked_oracle_home]/tech_st/10.1.2″ TYPE=”O” IDX=”1″/>


ooops … i dont …. THIS IS THE ISSUE

So what should i do now?

Pretty simple, add an entry for this Oracle Home just above or below HOME_LIST tag.

<HOME NAME=”SID_TOOLS__masked_oracle_home_tech_st_10_1_3″ LOC=”[masked_oracle_home]/tech_st/10.1.3″ TYPE=”O” IDX=”2″/>

After making changes,

<HOME NAME=”SID_TOOLS__masked_oracle_home_tech_st_10_1_2″ LOC=”[masked_oracle_home]/tech_st/10.1.2″ TYPE=”O” IDX=”1″/>
<HOME NAME=”SID_WEBOH__masked_oracle_home_tech_st_10_1_3″ LOC=”[masked_oracle_home]/tech_st/10.1.3″ TYPE=”O” IDX=”2″/>

Save the file.

Now you retry the same command it should go through.

If you dont want to update your inventory.xml which is under the global inventory location, you can pass a parameter to the opatch utility to use a different inventory location provided that inventory has information about this oracle home.

opatch -invPtrLoc [New .loc file location]

Happy troubleshooting !!!!


Read Full Post | Make a Comment ( 3 so far )

Oracle Applications – 11i / R12 – Missing Patches Analysis

Posted on May 21, 2008. Filed under: DBA/Admin Tips, Patch | Tags: , , , |

Every organisation has more than one oracle apps instance for different purpose viz., PROD, TEST, DEV etc. and generating a report on missing apps patches on the available instances is a pain if it has to be done manually.

Often, the TEST instances will have more patches when compared to PROD, reason being first the patch will have to be tested on a TEST instance for resolving an issue on PROD or DEV, then it will be moved to DEV and by the time the patch gets applied to PROD it will be a month or so, or may be even more than that depending on the management policies and severity of the issue for which the patch is applied on TEST or DEV.

Now lets say you want to compare DEV instance based on the patches applied to TEST instance.

1. Login to TEST instance as apps user
2. SQL Command: create table patch_list as (select distinct patch_name from ad_applied_patches);
3. Now PATCH_LIST table has all the patches that are applied to TEST instance.
4. Generate an insert script for the available patches.

SQL Command: spool patch_numbers.sql
SQL Command: select ‘insert into patch_list values(”’ || patch_name ||”’);’ from patch_list;
SQL Command: spool off

5. Login to the DEV instance as apps user
6. SQL Command: create table patch_list (patch_name varchar2(120));
7. Run patch_numbers.sql in this instance. This will populate the PATCH_LIST table with the TEST instance patches.
8. Run below sql to get the missing patches in DEV instance.

SQL Command: set heading off pages 0

SQL Command: select patch_list.* from patch_list LEFT JOIN ad_applied_patches ON patch_list.patch_name = ad_applied_patches.patch_name where ad_applied_patches.patch_name IS NULL;

The resulting output is the missing patches on DEV instance.

Above information can also be achieved without creating the PATCH_LIST table if DB_LINK is used. If using DB_LINK dont forget to modify the above query with correct column and table names.


Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...