How to remove an old GRID_HOME

This post is also available at: Português

Oracle Logo Banner
Oracle Logo Banner
$ cd /u01/app/oraInventory/ContentsXML
$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2023, 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="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2"/>
<HOME NAME="OraHome1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="3"/>
<HOME NAME="agent13c1" LOC="/oem_agent/agent_13.4.0.0.0" TYPE="O" IDX="4"/>
<HOME NAME="OraGI19Home2" LOC="/u01/app/19.0.0.0/grid1920" TYPE="O" IDX="5"/>
<HOME NAME="Orasidb19c_home1_2023_12_03_01_34" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_2" TYPE="O" IDX="6"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
Bash

The ORACLE_HOME I want to remove is OraGI19Home2.

1. Create a variable with the value of GRID_HOME, which will be removed.
$ export OLD_GRID_HOME=/u01/app/19.0.0.0/grid1920
2. Check that the GRID_HOME is in use.
This command will return the GRID_HOME that is being used by Grid Infrastructure.
$ $OLD_GRID_HOME/srvm/admin/getcrshome
/u01/app/19.0.0.0/grid
3. Uninstalling GRID_HOME
$ $OLD_GRID_HOME/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /u01/app/oraInventory/logs/

.
.
.
####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
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.

Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'oracleserver'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL TOOL END #############
Bash
4. Validation and removal of remaining files

To validate the removal, check the inventory.xml for the entry REMOVED=“T”.

$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2023, 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="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2"/>
<HOME NAME="OraHome1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="3"/>
<HOME NAME="agent13c1" LOC="/oem_agent/agent_13.4.0.0.0" TYPE="O" IDX="4"/>
<HOME NAME="Orasidb19c_home1_2023_12_03_01_34" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_2" TYPE="O" IDX="6"/>
<HOME NAME="OraGI19Home2" LOC="/u01/app/19.0.0.0/grid1920" TYPE="O" IDX="5" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
Bash

If any files were left in the old ORACLE_HOME directory due to permissions during execution, you can safely remove them, as they have already been removed from the inventory.

References:

DohDatabase

Previous Article

LsInventorySession failed: RawInventory gets null OracleHomeInfo

Next Article

gDBClone a script you NEED to know

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *