This post is also available in:
After upgrading Oracle Grid Infrastructure, the old GRID_HOME often stays behind — its binaries, configuration files, and inventory entry all still present on the system. The deinstall utility is the Oracle-supported way to clean everything up in one shot.
💡 If the Oracle Home directory was already deleted manually and you only need to clean up the
inventory.xmlentry, this is not the right procedure. See: How to Remove an ORACLE_HOME from inventory.xml Using runInstaller.
Prerequisites
- The GRID_HOME you want to remove must not be the active one. CRS must be running from a different home.
- Run as the Grid Infrastructure owner (
gridororacle, depending on your setup).
1. Identify the GRID_HOME to remove
Check inventory.xml to list all registered homes:
cat /u01/app/oraInventory/ContentsXML/inventory.xmlExample output:
<HOME_LIST>
<HOME NAME="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>
<HOME NAME="OraGI19Home2" LOC="/u01/app/19.0.0.0/grid1920" TYPE="O" IDX="5"/>
<HOME NAME="OraHome1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="3"/>
</HOME_LIST>The active home is OraGI19Home1 (note the CRS="true" attribute). The candidate for removal is OraGI19Home2.
2. Export the path of the home to remove
export OLD_GRID_HOME=/u01/app/19.0.0.0/grid19203. Confirm which GRID_HOME is currently active
⚠️ Do not skip this step. The deinstall utility permanently removes binaries and configuration files. Confirming the active home before proceeding is the difference between a clean decommission and taking down your production environment.
$OLD_GRID_HOME/srvm/admin/getcrshomeExpected output — must point to a different home than $OLD_GRID_HOME:
/u01/app/19.0.0.0/gridIf the output matches $OLD_GRID_HOME, stop immediately. You have the wrong home exported.
4. Run the deinstall
$OLD_GRID_HOME/deinstall/deinstallThe process is interactive and will ask for confirmations. A successful run ends with:
Successfully detached Oracle home '/u01/app/19.0.0.0/grid1920' from the central inventory on the local node.
Successfully deleted directory '/u01/app/19.0.0.0/grid1920' on the local node.
Oracle Universal Installer cleanup was successful.5. Validate the result in inventory.xml
cat /u01/app/oraInventory/ContentsXML/inventory.xmlThe removed home will now show REMOVED="T":
<HOME NAME="OraGI19Home2" LOC="/u01/app/19.0.0.0/grid1920" TYPE="O" IDX="5" REMOVED="T"/>💡 This is expected behavior —
deinstallmarks the entry as removed rather than deleting it from the XML. OUI ignores entries flagged withREMOVED="T"in future operations. If you need the entry completely gone from the file, userunInstaller -detachHomeas covered here: How to Remove an ORACLE_HOME from inventory.xml.
6. Leftover files
If any files remain in the directory due to permission issues during deinstall, it is safe to remove them manually — the home is already detached from the inventory:
rm -rf /u01/app/19.0.0.0/grid1920Quick Reference
export OLD_GRID_HOME=/u01/app/19.0.0.0/grid1920
$OLD_GRID_HOME/srvm/admin/getcrshome
$OLD_GRID_HOME/deinstall/deinstall
cat /u01/app/oraInventory/ContentsXML/inventory.xml
rm -rf $OLD_GRID_HOME