opatch inventory 查詢時報錯"LsInventory: OPatch Exception while accessing O2O"

hurp_oracle發表於2014-12-14

在一次10.2.0.4升級到11.2.0.3.5升級專案中,遇到一個小問題(在查詢opatch lsinventory 由於存在two oraInst.loc files 導致)

[oracle@tqd1a] /oracle/app/product/10.2.0/database/OPatch> ./opatch lsinventory


Oracle Interim Patch Installer version 1.0.0.0.57
Copyright (c) 2007 Oracle Corporation. All Rights Reserved..


We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document
293369.1 which is viewable from metalink.oracle.com


Oracle Home           : /oracle/app/product/10.2.0/database
Oracle Home Inventory : /oracle/app/product/10.2.0/database/inventory
Central Inventory     : /oracle/app/oraInventory
   from               : /etc/oraInst.loc
OUI location          : /oracle/app/product/10.2.0/database/oui
OUI shared library    : /oracle/app/product/10.2.0/database/oui/lib/aix/liboraInstaller.so
Java location         : /oracle/app/product/10.2.0/database/jre/1.4.2/bin/java
Log file location     : /oracle/app/product/10.2.0/database/.patch_storage//*.log


Creating log file "/oracle/app/product/10.2.0/database/.patch_storage/LsInventory__12-14-2014_20-05-42.log"


Result: 


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
  null
  


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.


Metalink如是說:

Applies to:

Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 10.2.0.3
This problem can occur on any platform.

Symptoms

Running the command "opatch lsinventory" gives following error :- 

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 
null 
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.

Cause

Trying to use a different name for oraInst.loc file. 

opatch can understand only the name oraInst.loc for inventory pointer location file.

So it will not recognize other names for example oraInst.loc_oracle9i 

In the above scenario there were two oraInst.loc files 

1.oraInst.loc 
2.oraInst.loc_oracle9i 

Tried running opatch lsinventory using inventory pointer file oraInst.loc_oracle9i, but it caused the error since opatch can understand oraInst.loc only.

Solution


(1)As two files with same name can not reside in a single directory, keep different oraInst.loc files in different directories and maintain a record of it. 

(2)Change inventory pointer location files name to oraInst.loc 

% mv oraInst.loc_oracle9i oraInst.loc 

(3) Set the ORACLE_HOME 

(4)Now run opatch lsinventory -invPtrLoc with correct file name. 
%opatch lsinventory -invPtrLoc


最終解決方案:

改檔案inventory.xml中的$ORACLE_HOME路徑
說明:在tar包安裝Oracle的過程中由於可能目標機器和源機器的目錄發上改變導致出現以上問題,所以多留意一下就沒什麼問題了

[oracle@tqd1b] /oracle/app/oraInventory/ContentsXML> vi inventory.xml
"inventory.xml" 17 lines, 505 characters 

<!-- Copyright (c) 2002 Oracle Corporation. All rights Reserved --&gt
<!-- Do not modify the contents of this file by hand. --&gt


   10.1.0.3.0
   2.1.0.6.0


/oracle/app/product/10.2.0/database" TYPE="O" IDX="1">
   
     
     
   




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29446986/viewspace-1367682/,如需轉載,請註明出處,否則將追究法律責任。

相關文章