This post is also available at:
Português

I recently removed a directory that was an ORACLE_HOME, to recreate it later, but I forgot to uninstall it from inventory.xml.
Fortunately, there is an easy way to remove it from inventory.xml without any major headaches, you just need to have another oracle binary on the server.
inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2025, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>12.2.0.7.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="agent13c1" LOC="/oem_agent/agent_13.4.0.0.0" TYPE="O" IDX="4"/>
<HOME NAME="agent13c2" LOC="/oem_agent/agent_13.5.0.0.0" TYPE="O" IDX="5"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2"/>
<HOME NAME="OraHome1" LOC="/oem_agent/GoldImage_OEM_13.5_33355570/agent_13.5.0.0.0" TYPE="O" IDX="8"/>
<HOME NAME="Orasiha19c_home1_3279" LOC="/u01/app/19.23.0.0/grid" TYPE="O" IDX="9"/>
<HOME NAME="Orasidb19c_home1_4607" LOC="/u01/app/oracle/product/19.23.0.0/dbhome_1" TYPE="O" IDX="10"/>
<HOME NAME="Orasiha19c_home1_4621" LOC="/u01/app/19.25.0.0/grid" TYPE="O" IDX="11" CRS="true">
<NODE_LIST>
<NODE NAME="cealtwdsbr01"/>
</NODE_LIST>
</HOME>
<HOME NAME="Orasidb19c_home1_9789" LOC="/u01/app/oracle/product/19.25.0.0/dbhome_1" TYPE="O" IDX="12"/>
<HOME NAME="Orasiha19c_home1_5292" LOC="/u01/app/19.26.0.0/grid" TYPE="O" IDX="13"/>
<HOME NAME="Orasidb19c_home1_2380" LOC="/u01/app/oracle/product/19.26.0.0/dbhome_1" TYPE="O" IDX="14"/>
<HOME NAME="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" REMOVED="T"/>
<HOME NAME="OraDB19Home1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="3" REMOVED="T"/>
<HOME NAME="Orasiha19c_home1_1937" LOC="/u01/app/19.21.0.0/grid" TYPE="O" IDX="6" REMOVED="T"/>
<HOME NAME="Orasidb19c_home1_9425" LOC="/u01/app/oracle/product/19.21.0.0/dbhome_1" TYPE="O" IDX="7" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
BashThe ORACLE_HOME I want to remove is the one on line 24.
To do this, I run the command.
/u01/app/oracle/product/19.25.0.0/dbhome_1/oui/bin/runInstaller -silent -detachHome ORACLE_HOME="/u01/app/oracle/product/19.26.0.0/dbhome_1" ORACLE_HOME_NAME="Orasidb19c_home1_2380"
BashThe inventory.xml now no longer contains the ORACLE_HOME that we removed, unlike the procedure in this post, How to remove an old grid home, which marks it as REMOVED but still leaves the ORACLE_HOME in the inventory.xml.
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2025, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>12.2.0.7.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="agent13c1" LOC="/oem_agent/agent_13.4.0.0.0" TYPE="O" IDX="4"/>
<HOME NAME="agent13c2" LOC="/oem_agent/agent_13.5.0.0.0" TYPE="O" IDX="5"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2"/>
<HOME NAME="OraHome1" LOC="/oem_agent/GoldImage_OEM_13.5_33355570/agent_13.5.0.0.0" TYPE="O" IDX="8"/>
<HOME NAME="Orasiha19c_home1_3279" LOC="/u01/app/19.23.0.0/grid" TYPE="O" IDX="9"/>
<HOME NAME="Orasidb19c_home1_4607" LOC="/u01/app/oracle/product/19.23.0.0/dbhome_1" TYPE="O" IDX="10"/>
<HOME NAME="Orasiha19c_home1_4621" LOC="/u01/app/19.25.0.0/grid" TYPE="O" IDX="11" CRS="true">
<NODE_LIST>
<NODE NAME="cealtwdsbr01"/>
</NODE_LIST>
</HOME>
<HOME NAME="Orasidb19c_home1_9789" LOC="/u01/app/oracle/product/19.25.0.0/dbhome_1" TYPE="O" IDX="12"/>
<HOME NAME="Orasiha19c_home1_5292" LOC="/u01/app/19.26.0.0/grid" TYPE="O" IDX="13"/>
<HOME NAME="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" REMOVED="T"/>
<HOME NAME="OraDB19Home1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="3" REMOVED="T"/>
<HOME NAME="Orasiha19c_home1_1937" LOC="/u01/app/19.21.0.0/grid" TYPE="O" IDX="6" REMOVED="T"/>
<HOME NAME="Orasidb19c_home1_9425" LOC="/u01/app/oracle/product/19.21.0.0/dbhome_1" TYPE="O" IDX="7" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
Bash❓ Frequently Asked Questions
Is it safe to edit inventory.xml manually?
No. Oracle does not recommend manual changes. Always use runInstaller -detachHome
.
Do I need to restart the server after removing an ORACLE_HOME?
In general, this is not necessary, but make sure that no processes are in use.