报错:OPatch cannot find a valid oraInst.loc file to locate Central Inventory. OPatch failed with error code 104OPatch cannot find a valid oraInst.loc file to locate Central Inventory
命令:opatch lsinventory用于查看数据库所打Patch的列表。但运行的时候发现错误:
[oracle@bej301441 OPatch]$ opatch lsinventory
Invoking OPatch 11.1.0.6.2
Oracle Interim Patch Installer version 11.1.0.6.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/oracle/mc3yd213/db/tech_st/11.1.0
Central Inventory : n/a
from :
OPatch version : 11.1.0.6.2
OUI version : 11.1.0.7.0
OUI location : /u01/oracle/mc3yd213/db/tech_st/11.1.0/oui
Log file location : n/a
OPatch cannot find a valid oraInst.loc file to locate Central Inventory.
OPatch failed with error code 104
解决方法:
原因是opatch在默认目录下找不到oraInst.loc文件,对于Unix系统来说oraInst.loc的默认位置是: /etc/oraInst.loc 或者 /var/opt/oracle/oraInst.loc 。
这里我们可以需要指定具体的oraInst.loc文件位置给opatch。
命令:opatch lsinventory -invPtrLoc /u01/oracle/mc3yd213/db/tech_st/11.1.0/oraInst.loc
(/u01/oracle/mc3yd213/db/tech_st/11.1.0为我数据库的ORACLE_HOME)
完整的输出:
[oracle@bej301441 etc]$ opatch lsinventory -invPtrLoc /u01/oracle/mc3yd213/db/tech_st/11.1.0/oraInst.loc
Oracle Interim Patch Installer version 1.0.0.0.58
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 : /u01/oracle/mc3yd213/db/tech_st/11.1.0
Oracle Home Inventory : /u01/oracle/mc3yd213/db/tech_st/11.1.0/inventory
Central Inventory : /u01/oracle/mc3yd213/db/tech_st/11.1.0/admin/oui/mc3yd213_bej301441/oraInventory
from : /u01/oracle/mc3yd213/db/tech_st/11.1.0/oraInst.loc
OUI location : /u01/oracle/mc3yd213/db/tech_st/11.1.0/oui
OUI shared library : /u01/oracle/mc3yd213/db/tech_st/11.1.0/oui/lib/linux/liboraInstaller.so
Java location : /u01/oracle/mc3yd213/db/tech_st/11.1.0/jdk/jre/bin/java
Log file location : /u01/oracle/mc3yd213/db/tech_st/11.1.0/.patch_storage/<patch ID>/*.log
Creating log file "/u01/oracle/mc3yd213/db/tech_st/11.1.0/.patch_storage/LsInventory__05-10-2013_20-21-11.log"
Result:
Installed Patch List:
=====================
1) Patch 8199107 applied on Thu Mar 26 07:53:06 PDT 2009
[ Base Bug(s): 8199107 ]
2) Patch 7627743 applied on Thu Mar 26 07:52:01 PDT 2009
[ Base Bug(s): 7627743 ]
3) Patch 7639602 applied on Thu Mar 26 07:50:56 PDT 2009
[ Base Bug(s): 7639602 ]
4) Patch 7211965 applied on Thu Mar 26 07:49:52 PDT 2009
[ Base Bug(s): 7211965 ]
5) Patch 7708501 applied on Thu Mar 26 07:48:13 PDT 2009
[ Base Bug(s): 7708501 ]
6) Patch 7330434 applied on Thu Mar 26 07:47:02 PDT 2009
[ Base Bug(s): 7330434 ]
7) Patch 7580744 applied on Thu Mar 26 07:45:56 PDT 2009
[ Base Bug(s): 7580744 ]
8) Patch 7708340 applied on Thu Mar 26 07:44:38 PDT 2009
[ Base Bug(s): 7708340 ]
9) Patch 7327166 applied on Thu Mar 26 07:43:37 PDT 2009
[ Base Bug(s): 7327166 ]
10) Patch 7486407 applied on Thu Mar 26 07:42:26 PDT 2009
[ Base Bug(s): 7486407 ]
11) Patch 7243270 applied on Thu Mar 26 07:41:19 PDT 2009
[ Base Bug(s): 7243270 ]
12) Patch 7277741 applied on Thu Mar 26 07:41:07 PDT 2009
[ Base Bug(s): 7277741 ]
13) Patch 7319922 applied on Thu Mar 26 07:39:56 PDT 2009
[ Base Bug(s): 7319922 ]
14) Patch 4247037 applied on Thu Mar 26 07:38:44 PDT 2009
[ Base Bug(s): 4247037 ]
15) Patch 6530141 applied on Thu Mar 26 07:38:31 PDT 2009
[ Base Bug(s): 6530141 ]
16) Patch 6598432 applied on Thu Mar 26 07:37:26 PDT 2009
[ Base Bug(s): 6598432 ]
17) Patch 6815733 applied on Thu Mar 26 07:36:21 PDT 2009
[ Base Bug(s): 6815733 ]
18) Patch 6991626 applied on Thu Mar 26 07:35:16 PDT 2009
[ Base Bug(s): 6991626 ]
19) Patch 7111245 applied on Thu Mar 26 07:34:12 PDT 2009
[ Base Bug(s): 7111245 ]
20) Patch 7253531 applied on Thu Mar 26 07:31:41 PDT 2009
[ Base Bug(s): 7253531 ]
21) Patch 7556778 applied on Thu Mar 26 07:30:41 PDT 2009
[ Base Bug(s): 7556778 ]
22) Patch 7000281 applied on Thu Mar 26 07:29:31 PDT 2009
[ Base Bug(s): 7000281 ]
23) Patch 6263237 applied on Thu Mar 26 07:28:20 PDT 2009
[ Base Bug(s): 6263237 ]
24) Patch 6870937 applied on Thu Mar 26 07:27:07 PDT 2009
[ Base Bug(s): 6870937 ]
25) Patch 7295298 applied on Thu Mar 26 07:26:01 PDT 2009
[ Base Bug(s): 7295298 ]
26) Patch 6972189 applied on Thu Mar 26 07:24:42 PDT 2009
[ Base Bug(s): 6972189 ]
OPatch succeeded.
[oracle@bej301441 etc]$
*****************************oracle patch************************************
Invoking OPatch 10.2.0.5.1
Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation. All rights reserved.
Oracle Home : /opt/oracle/product/10.2.0
Central Inventory : /opt/oracle/oraInventory
from : /var/opt/oracle/oraInst.loc
OPatch version : 10.2.0.5.1
OUI version : 10.2.0.5.0
OUI location : /opt/oracle/product/10.2.0/oui
Log file location : /opt/oracle/product/10.2.0/cfgtoollogs/opatch/opatch2019-05-28_09-12-15AM.log
Patch history file: /opt/oracle/product/10.2.0/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /opt/oracle/product/10.2.0/cfgtoollogs/opatch/lsinv/lsinventory2019-05-28_09-12-15AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 4 10.2.0.5.0
There are 2 products installed in this Oracle Home.
Interim patches (1) :
Patch 16619894 : applied on Wed Sep 09 11:58:43 CST 2015
Unique Patch ID: 16594107
Created on 19 Jul 2013, 00:43:30 hrs PST8PDT
Bugs fixed:
13596521, 8865718, 11790175, 13489660, 9020537, 9772888, 8650138
8664189, 10091698, 14275629, 14469008, 10092858, 12551710, 7519406
9821321, 13349665, 8771916, 7509714, 16619894, 8822531, 10139235
10159846, 13257247, 8350262, 11792865, 7119382, 13632738, 11724962
16309604, 16309605, 16309606, 8966823, 9320130, 16961614, 16961615
13775862, 16961616, 11674645, 16961617, 16961618, 15877957, 7026523
16961619, 15877958, 15877959, 9399589, 14841459, 9672816, 13503598
9499302, 9150282, 9448311, 9659614, 13632743, 14220725, 9949948, 8882576
10327179, 7612454, 7111619, 9711859, 9714832, 9735237, 9952230, 15877960
12780098, 13561951, 15877961, 15877962, 14665116, 15877963, 8660422
11066597, 16703112, 16279401, 14546673, 14105702, 14459552, 9713537
14105703, 14105704, 13483152, 13737773, 13737775, 14269955, 12925532
12748240, 9694101, 14390396, 12862186, 12862187, 10249537, 14727319
9586877, 8211733, 6694396, 9548269, 7115910, 7710224, 9337325, 8354642
7602341, 14076510, 10157402, 11856395, 12565867, 6402302, 10327190
10269717, 13015379, 11693109, 14023636, 10017048, 8546356, 8394351
9024850, 13561750, 8224558, 9770451, 9360157, 8488233, 9109487, 10132870
14841558, 9171933, 16817117, 10173237, 9532911, 10068982, 7361418
10306945, 8666117, 11725006, 6157713, 10214450, 9184754, 14205448
8544696, 9767674, 16306019, 9323583, 8277300, 13343467, 16279211
9726739, 16382448, 13791364, 8412426, 10326338, 10165083, 10208905
12419392, 6651220, 9145204, 13554409, 11076894, 7450366, 11893577
8970313, 14492313, 6690853, 6011045, 14492314, 11814891, 10162036
14492315, 10248542, 14492316, 16742123, 9469117, 13359623, 9952270
9842573, 13343471, 12710774, 10324526, 14546638, 12419258, 9322219
8636407, 16056270, 10010310, 12828105, 9689310, 9390484, 13736501
13736502, 9824435, 13736503, 13736504, 13736505, 13736506, 9963497
9032322, 13736507, 12551700, 12551701, 14035825, 12551702, 11858315
12551703, 12551704, 10076669, 16270946, 12551705, 12551706, 14040433
12551707, 6076890, 14258925, 12551708, 9308296, 13916709, 12827745
12880299, 14038805, 13923855, 9072105, 8528171, 11737047
--------------------------------------------------------------------------------
OPatch succeeded.
Invoking OPatch 10.2.0.5.1
Oracle Interim Patch Installer version 10.2.0.5.1
OPatch version : 10.2.0.5.1
Patch history file: /opt/oracle/product/10.2.0/cfgtoollogs/opatch/opatch_history.txt
Oracle Database 10g Release 2 Patch Set 4 10.2.0.5.0
Patch 16619894 : applied on Wed Sep 09 11:58:43 CST 2015
Unique Patch ID: 16594107
OPatch succeeded.