Error:-
LsInventorySession failed: Oracle
Home inventory cannot be loaded.
Recently ,
while trying to get output from opatch lsinventory we faced following error.
[oratest@non-prod-db OPatch]$
./opatch lsinventory Oracle Interim Patch Installer
version 12.1.0.1.10 Copyright (c) 2025, Oracle
Corporation. All rights reserved. Oracle Home : /dbtest/dbdata/erp/12.1.0 Central Inventory :
/dbtest/dbdata/oraInventory
from :
/dbtest/dbdata/erp/12.1.0/oraInst.loc OPatch version : 12.1.0.1.10 OUI version : 12.1.0.2.0 Log file location :
/dbtest/dbdata/erp/12.1.0/cfgtoollogs/opatch/opatch2025-05-14_14-03-27PM_1.log List of Homes on this system: Inventory load failed... OPatch
cannot load inventory for the given Oracle Home. Possible causes are:
Oracle Home dir. path does not exist in Central Inventory
Oracle Home is a symbolic link
Oracle Home inventory is corrupted LsInventorySession failed: Oracle
Home inventory cannot be loaded. OPatch failed with error code 73 |
The Common Causes of above issues are
- Oracle
Home is not registered in the Central Inventory
- Corrupt
or missing inventory.xml
- Oracle
Home is a symbolic link
- File
permissions issues
- Incorrect
oraInst.loc path or content
Verify oraInst.loc
Check the content of the file:
[oratest@non-prod-db
OPatch]$ cat /dbtest/dbdata/erp/12.1.0/oraInst.loc inventory_loc=/dbtest/dbdata/oraInventory inst_group=oinstall |
So the content of oraInst.loc looks fine and pointing to correct
Central Inventory directory which actually exists and accessible.
Check for the Inventory File
[oratest@non-prod-db
OPatch]$ ls -l /dbtest/dbdata/oraInventory/ContentsXML/inventory.xml ls: cannot
access /dbtest/dbdata/oraInventory/ContentsXML/inventory.xml: No such file or
directory |
So while checking the inventory.xml we found that the file is
missing. which confirms the central inventory is broken or uninitialized, which
is why opatch lsinventory is failing.
We will need to re-register Oracle Home with the central
inventory using the runInstaller tool.
·
Backup Inventory Directory (Optional but
Recommended)
$mv /dbtest/dbdata/oraInventory
/dbtest/dbdata/oraInventory_backup_$(date +%Y%m%d) |
·
Create a Fresh Inventory Directory:-
mkdir -p
/dbtest/dbdata/oraInventory/ContentsXML chown -R oratest:oinstall
/dbtest/dbdata/oraInventory chmod -R 775
/dbtest/dbdata/oraInventory |
·
Re-register the Oracle Home
[oratest@non-prod-db OPatch]$
/dbtest/dbdata/erp/12.1.0/oui/bin/runInstaller -silent -attachHome
ORACLE_HOME="/dbtest/dbdata/erp/12.1.0"
ORACLE_HOME_NAME="OraHome1" Starting Oracle Universal
Installer... Checking swap space: must be
greater than 500 MB. Actual 32700
MB Passed The inventory pointer is located
at /etc/oraInst.loc 'AttachHome' was successful. |
Now , lets
try opatch lsinventory
[oratest@non-prod-db OPatch]$
./opatch lsinventory Oracle Interim Patch Installer
version 12.1.0.1.10 Copyright (c) 2025, Oracle Corporation. All rights reserved. Oracle Home : /dbtest/dbdata/erp/12.1.0 Central Inventory :
/dbtest/dbdata/oraInventory
from :
/dbtest/dbdata/erp/12.1.0/oraInst.loc OPatch version : 12.1.0.1.10 OUI version : 12.1.0.2.0 Log file location :
/dbtest/dbdata/erp/12.1.0/cfgtoollogs/opatch/opatch2025-05-14_14-08-28PM_1.log Lsinventory Output file location :
/dbtest/dbdata/erp/12.1.0/cfgtoollogs/opatch/lsinv/lsinventory2025-05-14_14-08-28PM.txt -------------------------------------------------------------------------------- Local Machine Information:: Hostname: non-prod-db.com ARU platform id: 226 ARU platform description:: Linux
x86-64 Oracle Database 12c
12.1.0.2.0 Oracle Database 12c Examples
12.1.0.2.0 There are 2 products installed in
this Oracle Home. Patch 25305405
: applied on Tue Feb 13 16:12:11 IST 2018 Unique Patch ID: 21701443
Created on 9 Nov 2017, 03:39:35 hrs PST8PDT
Bugs fixed: 25305405 Patch 25906117
: applied on Tue Feb 13 16:05:01 IST 2018 Unique Patch ID: 21296770
Created on 26 May 2017, 03:18:37 hrs PST8PDT
Bugs fixed: 25906117 -------------------------------------------------------------------------------- OPatch succeeded. |
So, this is
how issue was resolved.
No comments:
Post a Comment