OPatch failed with error code 73, The Central Inventory is corrupted and The oraInst.loc file specified is not valid Error Solution

Hi,

When I query the Patch details of Oracle, I got ” OPatch failed with error code 73, The Central Inventory is corrupted and The oraInst.loc file specified is not valid ” Error.

Details of error are as follows.

[MSDB1]/home/oracle $ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2020, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app18c
Central Inventory : /u01/app/oraInventory
   from           : /u01/app18c/oraInst.loc
OPatch version    : 12.2.0.1.17
OUI version       : 12.2.0.4.0
Log file location : /u01/app18c/cfgtoollogs/opatch/opatch2020-03-25_12-17-29PM_1.log

LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are: 
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.

OPatch failed with error code 73
[MSDB1]/home/oracle $ exit
logout
[mehmetsalih@msdbadm01 ~]$ 
[mehmetsalih@msdbadm01 ~]$ dzdo su - grid
[grid@msdbadm01 ~]$ 
[grid@msdbadm01 ~]$ 
[grid@msdbadm01 ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.14
Copyright (c) 2020, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/grid/oraInst.loc
OPatch version    : 12.2.0.1.14
OUI version       : 12.2.0.4.0
Log file location : /u01/grid/cfgtoollogs/opatch/opatch2020-03-25_11-18-39AM_1.log

LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are: 
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.

OPatch failed with error code 73
[grid@msdbadm01 ~]$


 

When I check oraInventory directory, i saw that oraInventory ownership is not oracle:oinstall as follows.

Backup the related directory and modify its ownership as follows.

[root@msdbadm01 ~]# cd /u01/app
[root@msdbadm01 app]# 
[root@msdbadm01 app]# ls -ltr
total 24
drwxr-xr-x 11 grid   oinstall 4096 Aug  2  2019 grid
drwxr-x---  8 root   root     4096 Aug  7  2019 oraInventoryBackup0882019
drwxr-xr-x  2 root   oinstall 4096 Nov 18 15:47 12.2.0.1
drwxr-xr-x 11 oracle oinstall 4096 Feb 26 09:43 oracle
drwxrwx---  8 ggate  oinstall 4096 Mar 25 13:02 oraInventory
[root@msdbadm01 app]# 
[root@msdbadm01 app]# 
[root@msdbadm01 app]# cp -pr oraInventory oraInventoryBackup25032020
[root@msdbadm01 app]# 
[root@msdbadm01 app]# 
[root@msdbadm01 app]# ls -ltr
total 28
drwxr-xr-x 11 grid   oinstall 4096 Aug  2  2019 grid
drwxr-xr-x  2 root   oinstall 4096 Nov 18 15:47 12.2.0.1
drwxr-xr-x 11 oracle oinstall 4096 Feb 26 09:43 oracle
drwxrwx---  8 ggate  oinstall 4096 Mar 25 13:02 oraInventoryBackup25032020
drwxrwx---  8 ggate  oinstall 4096 Mar 25 13:02 oraInventory
[root@msdbadm01 app]# 
[root@msdbadm01 app]# 
[root@msdbadm01 app]# chown oracle:oinstall oraInventory
[root@msdbadm01 app]#

 

Check the subdirectory of oraInventory ownership, i saw that they are not oracle:oinstall.

Modify their ownership as follows.

 

[root@msdbadm01 oraInventory]# ls -ltr
total 52
drwxrwx---  2 ggate ggate  4096 Jan 18  2018 ContentsXML
-rwxrwx---  1 ggate ggate  1620 Jan 18  2018 orainstRoot.sh
-rw-rw----  1 ggate ggate    56 Jan 18  2018 oraInst.loc
drwxrwx---  2 ggate ggate  4096 Jan 18  2018 oui
drwxrw----  2 ggate ggate  4096 Aug  1  2019 locksBackup
drwxrwx--- 16 ggate ggate  4096 Aug  7  2019 backup
drwxrw----  2 ggate ggate  4096 Aug  7  2019 locks
drwxrwx--- 11 ggate ggate 20480 Aug  7  2019 logs
[root@msdbadm01 oraInventory]# 
[root@msdbadm01 oraInventory]# 
[root@msdbadm01 oraInventory]# chown -R oracle:oinstall *
[root@msdbadm01 oraInventory]# 
[root@msdbadm01 oraInventory]# 
[root@msdbadm01 oraInventory]# ls -ltr
total 52
drwxrwx---  2 oracle oinstall  4096 Jan 18  2018 ContentsXML
-rwxrwx---  1 oracle oinstall  1620 Jan 18  2018 orainstRoot.sh
-rw-rw----  1 oracle oinstall    56 Jan 18  2018 oraInst.loc
drwxrwx---  2 oracle oinstall  4096 Jan 18  2018 oui
drwxrw----  2 oracle oinstall  4096 Aug  1  2019 locksBackup
drwxrwx--- 16 oracle oinstall  4096 Aug  7  2019 backup
drwxrw----  2 oracle oinstall  4096 Aug  7  2019 locks
drwxrwx--- 11 oracle oinstall 20480 Aug  7  2019 logs
[root@msdbadm01 oraInventory]#

 

When I try to run opatch lsinventory command again.

[root@msdbadm01 oraInventory]# 
[root@msdbadm01 oraInventory]# su - oracle
The Oracle base has been set to /u01/app/oracle
The Oracle base remains unchanged with value /u01/app/oracle
-bash: cd: /u01/app/oracle/admin/MSDB1: No such file or directory
------------------------------------------------------------
Host :msdbadm01.deveci.local
Env for :MSDB1
Ora Home:/u01/app18c
TNS loc :/u01/app18c/network/admin
------------------------------------------------------------
[MSDB1]/home/oracle $ 
[MSDB1]/home/oracle $ 
[MSDB1]/home/oracle $ 
[MSDB1]/home/oracle $ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2020, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app18c
Central Inventory : /u01/app/oraInventory
from : /u01/app18c/oraInst.loc
OPatch version : 12.2.0.1.17
OUI version : 12.2.0.4.0
Log file location : /u01/app18c/cfgtoollogs/opatch/opatch2020-03-25_13-05-46PM_1.log

Lsinventory Output file location : /u01/app18c/cfgtoollogs/opatch/lsinv/lsinventory2020-03-25_13-05-46PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: msdbadm01.deveci.local
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 18c 18.0.0.0.0
There are 1 products installed in this Oracle Home.


Interim patches (3) :

Patch 29757256 : applied on Fri Aug 02 21:40:36 EET 2019
Unique Patch ID: 22988612
Patch description: "Database Release Update : 18.7.0.0.190716 (29757256)"
Created on 26 Jun 2019, 05:59:21 hrs PST8PDT
Bugs fixed:
8932139, 9062315, 13554903, 14221306, 20436508, 21095391, 21223848
21547051, 21744603, 21766220, 21806121, 23003564, 23061453, 23310101
23761724, 24489904, 24689376, 24737581, 24841671, 24844841, 24903291
24925863, 24971597, 25035594, 25035599, 25287072, 25293659, 25303284
25309116, 25348956, 25405687, 25487146, 25591292, 25607397, 25634405
25644811, 25663488, 25686739, 25726981, 25736428, 25743479, 25756945
25824236, 25882883, 25890002, 25908728, 25911069, 25929650, 25943740
25958554, 25986062, 25997810, 26083489, 26115103, 26164661, 26226953
26237338, 26281476, 26284722, 26297826, 26336101, 26362155, 26399691
26422277, 26423085, 26427905, 26440169, 26450454, 26476244, 26521043
26536320, 26595088, 26598422, 26615291, 26617804, 26646549, 26654411
26694735, 26731697, 26745002, 26785169, 26790514, 26792891, 26818960
26822620, 26843558, 26843664, 26846077, 26871815, 26883456, 26894737
26895149, 26898279, 26927998, 26928317, 26933599, 26943004, 26956033
26960097, 26961415, 26966120, 26966916, 26970175, 26985002, 26986173
26992964, 27000158, 27005278, 27006120, 27006664, 27016033, 27026401
27028251, 27030974, 27034688, 27035653, 27036408, 27037839, 27038986
27041253, 27044575, 27047831, 27053044, 27054231, 27058530, 27060167
27060859, 27061736, 27066451, 27066519, 27073066, 27075854, 27080874
27086821, 27090765, 27093423, 27101105, 27101527, 27101652, 27105900
27106301, 27110878, 27111780, 27112686, 27115422, 27119621, 27122162
27125872, 27126666, 27128580, 27135647, 27142529, 27143756, 27143882
27147979, 27150500, 27151826, 27152892, 27153641, 27155549, 27156355
27160360, 27160922, 27163928, 27164352, 27165231, 27166354, 27169796
27169888, 27170305, 27179264, 27181521, 27181537, 27181897, 27185188
27187440, 27189611, 27190851, 27193810, 27197334, 27199245, 27200959
27202015, 27208795, 27208953, 27210038, 27210263, 27210872, 27214085
27215007, 27216046, 27216224, 27220937, 27221900, 27222121, 27222626
27223075, 27224987, 27226913, 27228786, 27229389, 27231051, 27232983
27233563, 27236052, 27236110, 27236722, 27240246, 27240570, 27241221
27241247, 27242226, 27242616, 27244337, 27244785, 27249215, 27249531
27250547, 27251690, 27254851, 27255377, 27256000, 27256488, 27256534
27256584, 27258578, 27259307, 27259386, 27259983, 27262601, 27262650
27262798, 27262945, 27262991, 27263276, 27263996, 27266245, 27270197
27274456, 27274536, 27275136, 27275533, 27275776, 27276231, 27282707
27283029, 27283960, 27284375, 27284499, 27285244, 27288230, 27288638
27288894, 27292213, 27293599, 27294480, 27301308, 27301568, 27302594
27302632, 27302681, 27302695, 27302711, 27302714, 27302730, 27302777
27302800, 27302960, 27303287, 27303785, 27303938, 27304410, 27304936
27305318, 27307868, 27308088, 27310092, 27313687, 27314206, 27314390
27318117, 27318869, 27320576, 27321179, 27321834, 27326204, 27329812
27330158, 27330161, 27333658, 27333664, 27333693, 27333731, 27334316
27334648, 27335682, 27338912, 27338946, 27339115, 27339396, 27339483
27339495, 27341036, 27345190, 27345231, 27345450, 27345498, 27346329
27346644, 27346709, 27346949, 27347126, 27348081, 27348707, 27349393
27350267, 27351628, 27352600, 27354783, 27356373, 27357773, 27358241
27359178, 27359368, 27360126, 27364854, 27364891, 27364916, 27364947
27365139, 27365702, 27365993, 27367194, 27368850, 27372756, 27375260
27375542, 27376871, 27378103, 27379233, 27381383, 27381417, 27381498
27381656, 27384222, 27386467, 27389352, 27392187, 27394086, 27395404
27395416, 27395794, 27396357, 27396365, 27396377, 27396624, 27396666
27396672, 27396813, 27397048, 27398080, 27398660, 27400416, 27400598
27401637, 27404668, 27405242, 27405645, 27405696, 27410279, 27410300
27410595, 27412805, 27416327, 27416997, 27417186, 27420715, 27421101
27421733, 27422874, 27423251, 27424405, 27425507, 27425622, 27426363
27427805, 27430802, 27432062, 27432338, 27432355, 27432826, 27433870
27434050, 27434193, 27434486, 27434974, 27435537, 27439835, 27441326
27441980, 27442041, 27444727, 27445330, 27445462, 27445727, 27447452
27447687, 27448162, 27449814, 27450355, 27450400, 27450783, 27451049
27451182, 27451187, 27451531, 27452046, 27452760, 27453225, 27454722
27457666, 27457891, 27458164, 27459909, 27460675, 27462994, 27466597
27467543, 27468303, 27469245, 27469329, 27471876, 27472969, 27473800
27479358, 27480784, 27483974, 27484556, 27486253, 27487309, 27487795
27487919, 27489719, 27493674, 27496224, 27496308, 27496424, 27497950
27498477, 27501327, 27501413, 27501465, 27502420, 27504190, 27504770
27505229, 27505603, 27506774, 27507968, 27508985, 27510959, 27511196
27512439, 27517818, 27518227, 27518310, 27520070, 27520900, 27522245
27523368, 27523800, 27525909, 27526744, 27532375, 27533819, 27534509
27537472, 27539757, 27540613, 27541286, 27541468, 27542824, 27544030
27544973, 27545630, 27547732, 27550341, 27551855, 27554074, 27555481
27558557, 27558559, 27558861, 27560602, 27560702, 27562488, 27563629
27563767, 27565906, 27567477, 27570318, 27576342, 27577758, 27578007
27579353, 27580996, 27585755, 27585800, 27586810, 27586895, 27587672
27591842, 27592466, 27593389, 27593501, 27593585, 27595973, 27599689
27599927, 27601118, 27602091, 27602488, 27603841, 27604293, 27607563
27607805, 27608669, 27610269, 27613080, 27613247, 27613530, 27615608
27616657, 27617522, 27617978, 27620808, 27623844, 27625274, 27625620
27629756, 27631506, 27634676, 27634991, 27635508, 27644757, 27645940
27649707, 27652302, 27654521, 27655217, 27658186, 27658205, 27662528
27663370, 27664702, 27666312, 27671633, 27679488, 27679664, 27679793
27679806, 27679961, 27680162, 27680509, 27680669, 27682151, 27686599
27688036, 27688099, 27688692, 27690513, 27690578, 27691809, 27691920
27691939, 27692215, 27693416, 27693713, 27694261, 27695063, 27697092
27698953, 27700466, 27701795, 27704237, 27705761, 27707544, 27709046
27710072, 27718914, 27719187, 27723002, 27723151, 27726269, 27726780
27729678, 27732323, 27733415, 27739006, 27740424, 27740844, 27744211
27745220, 27747869, 27748954, 27751006, 27751755, 27753336, 27756900
27757567, 27757794, 27757888, 27758972, 27759077, 27759457, 27761402
27766324, 27767081, 27772093, 27772815, 27773602, 27774320, 27774539
27779886, 27780562, 27782339, 27783289, 27786772, 27791223, 27793533
27797290, 27801337, 27803665, 27807441, 27810967, 27812560, 27812593
27813267, 27815347, 27818871, 27824540, 27824543, 27825241, 27829295
27832643, 27833369, 27833672, 27834551, 27834984, 27835925, 27839353
27840386, 27843646, 27846298, 27846499, 27847259, 27849825, 27851757
27856471, 27861226, 27861452, 27861909, 27869075, 27869339, 27873643
27876671, 27882176, 27892488, 27896443, 27896458, 27898015, 27900663
27908644, 27912301, 27918832, 27920184, 27924147, 27926113, 27930478
27931299, 27934468, 27935348, 27938736, 27940876, 27941110, 27941896
27945870, 27948050, 27948153, 27950708, 27952762, 27959594, 27960021
27961746, 27964051, 27965830, 27966472, 27970265, 27971503, 27971575
27972265, 27975778, 27977039, 27983174, 27984028, 27986817, 27989556
27989849, 27991970, 27993289, 27994325, 27994333, 27995215, 27995248
27997875, 27998003, 27999073, 27999597, 27999638, 28000269, 28004853
28006704, 28018962, 28019283, 28021205, 28022101, 28022847, 28023081
28023399, 28023482, 28024347, 28026866, 28033429, 28036487, 28045903
28057267, 28058612, 28059199, 28067846, 28072130, 28072464, 28072567
28074713, 28085865, 28088762, 28090453, 28091981, 28098865, 28103600
28103869, 28104361, 28106402, 28108003, 28108898, 28111583, 28120036
28120951, 28124631, 28129791, 28132287, 28135648, 28165439, 28165545
28169711, 28174827, 28174951, 28175445, 28180464, 28181021, 28184554
28184800, 28187706, 28188330, 28189466, 28194173, 28199085, 28201419
28204443, 28209341, 28210192, 28211734, 28214943, 28215510, 28218832
28220398, 28223871, 28226179, 28227512, 28229360, 28236305, 28238264
28242712, 28258608, 28264172, 28271119, 28271693, 28279837, 28281094
28282606, 28285766, 28290434, 28302049, 28304709, 28305001, 28305362
28309182, 28312508, 28315031, 28315995, 28319623, 28320117, 28320399
28321446, 28323201, 28328895, 28329450, 28330714, 28333072, 28338399
28338999, 28344964, 28350595, 28354603, 28357401, 28361083, 28361221
28361787, 28365111, 28369092, 28371123, 28378446, 28379065, 28385102
28390273, 28391582, 28392168, 28392251, 28393678, 28396445, 28403295
28413955, 28420042, 28420457, 28423598, 28432129, 28434028, 28435825
28445741, 28448314, 28455212, 28468312, 28475164, 28478676, 28481149
28481679, 28483184, 28489150, 28492362, 28493478, 28501075, 28502403
28502773, 28503484, 28504545, 28507324, 28508053, 28508296, 28508557
28512761, 28513333, 28514693, 28521330, 28527416, 28528349, 28535272
28544633, 28545134, 28545687, 28547068, 28553468, 28571483, 28572834
28578164, 28580528, 28584193, 28584217, 28584444, 28587723, 28600233
28612674, 28614072, 28617631, 28617959, 28621470, 28627255, 28632559
28636676, 28644549, 28646200, 28670445, 28673203, 28679454, 28680029
28685371, 28692275, 28695694, 28702188, 28708023, 28710827, 28713840
28714058, 28728040, 28728272, 28730076, 28742555, 28747182, 28749289
28752599, 28755011, 28758090, 28758722, 28761812, 28767240, 28770146
28774416, 28777214, 28781754, 28785022, 28785531, 28803345, 28805612
28805695, 28809909, 28819640, 28849751, 28852691, 28856060, 28856172
28878525, 28881723, 28887509, 28891984, 28919145, 28925880, 28938924
28940179, 28951014, 28951382, 28956908, 28960211, 28986231, 28987454
28993353, 28993590, 29000190, 29006527, 29015118, 29015706, 29024054
29027694, 29032276, 29033896, 29037290, 29051702, 29056270, 29123482
29125374, 29136111, 29139591, 29158680, 29171683, 29177886, 29189889
29200700, 29203604, 29205918, 29224605, 29230565, 29242017, 29301463
29314539, 29331209, 29331493, 29339155, 29347981, 29356752, 29364171
29376346, 29378913, 29379978, 29382784, 29388020, 29388952, 29394749
29395657, 29405462, 29409149, 29412269, 29429264, 29430524, 29436454
29437712, 29439522, 29504682, 29511611, 29531541, 29542449, 29616244
29676089, 29813494

Patch 27923415 : applied on Wed Jul 18 20:41:38 EET 2018
Unique Patch ID: 22239273
Patch description: "OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)"
Created on 15 Jul 2018, 10:33:22 hrs PST8PDT
Bugs fixed:
27304131, 27539876, 27952586, 27642235, 27636900, 27461740

Patch 28090553 : applied on Wed Jul 18 20:40:01 EET 2018
Unique Patch ID: 22256940
Patch description: "OCW RELEASE UPDATE 18.3.0.0.0 (28090553)"
Created on 11 Jul 2018, 19:20:31 hrs PST8PDT
Bugs fixed:
12816839, 18701017, 22734786, 23698980, 23840305, 25709124, 25724089
26299684, 26313403, 26433972, 26527054, 26586174, 26587652, 26647619
26827699, 26860285, 26882126, 26882316, 26943660, 26996813, 27012915
27018734, 27032726, 27034318, 27040560, 27080748, 27086406, 27092991
27098733, 27106915, 27114112, 27121566, 27133637, 27144533, 27153755
27166715, 27174938, 27174948, 27177551, 27177852, 27182006, 27182064
27184253, 27204476, 27212837, 27213140, 27220610, 27222423, 27222938
27238077, 27238258, 27249544, 27252023, 27257509, 27263677, 27265816
27267992, 27271876, 27274143, 27285557, 27299455, 27300007, 27302415
27309182, 27314512, 27315159, 27320985, 27334353, 27338838, 27346984
27358232, 27362190, 27370933, 27377219, 27378959, 27379846, 27379956
27393421, 27398223, 27399499, 27399762, 27399985, 27401618, 27403244
27404599, 27426277, 27428790, 27430219, 27430254, 27433163, 27452897
27458829, 27465480, 27475272, 27481406, 27481765, 27492916, 27496806
27503318, 27503413, 27508936, 27508984, 27513114, 27519708, 27526362
27528204, 27532009, 27534289, 27560562, 27560735, 27573154, 27573408
27574335, 27577122, 27579969, 27581484, 27593587, 27595801, 27600706
27609819, 27625010, 27625050, 27627992, 27654039, 27657467, 27657920
27668379, 27682288, 27691717, 27702244, 27703242, 27708711, 27714373
27725967, 27731346, 27734470, 27735534, 27739957, 27740854, 27747407
27748321, 27757979, 27766679, 27768034, 27778433, 27782464, 27783059
27786669, 27786699, 27801774, 27811439, 27839732, 27850736, 27862636
27864737, 27865439, 27889841, 27896388, 27897639, 27906509, 27931506
27935826, 27941514, 27957892, 27978668, 27984314, 27993298, 28023410
28025398, 28032758, 28039471, 28039953, 28045209, 28099592, 28109698
28174926, 28182503, 28204423, 28240153

--------------------------------------------------------------------------------

OPatch succeeded.
[MSDB1]/home/oracle $

 

 

Problem has been solved.

 

If your oraInventory directory ownership is correct, but you are also getting the above errors,

To resolve the problem, copy $ORACLE_HOME/oraInst.loc to /var/opt/oracle/oraInst.loc

 

[MSDB1]/home/oracle $  cp $ORACLE_HOME/oraInst.loc  /var/opt/oracle/oraInst.loc

 

Or you can recreate the oraInventory directory as follows.

 

[MSDB1]/home/oracle $ cd $ORACLE_HOME/oui/bin
[MSDB1]/home/oracle $ ./runInstaller -silent -invPtrLoc "/etc/oraInst.loc" -attachHome ORACLE_HOME="/u01/app18c" ORACLE_HOME_NAME="Ora18cHome"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 18432 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory

'AttachHome' was successful.

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/

Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress mehmetsalih.deveci@outlook.com.-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

Leave a Reply