在一次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
最终解决方案:
[oracle@tqd1b] /oracle/app/oraInventory/ContentsXML> vi inventory.xml
"inventory.xml" 17 lines, 505 characters
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 2002 Oracle Corporation. All rights Reserved -->
<!-- Do not modify the contents of this file by hand. -->
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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29446986/viewspace-1367682/