Oracle: change Oracle home name

Are you annoyed by randomly created Oracle Home names? Here's how to change them to something more informative!

Oracle: change Oracle home name

When instaling Oracle database software, or other components, like clients, Connection Managers, Cloud Control Agents, the installer often creates a very random name for it, like home_1, OraClient23Home1 (although it's not a client, but a Connection Manager).

The name is saved in the inventory location. If you don't know where it is, just

cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall

Under /u01/app/oraInventory/ContentsXML, you can find the file inventory.xml. This is the content:

<?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
<!-- Copyright (c) 1999, 2025, Oracle. All rights reserved. -->
<!-- Do not modify the contents of this file by hand. --><INVENTORY>
   <VERSION_INFO>
      <SAVED_WITH>13.9.4.0.0</SAVED_WITH>
      <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
   </VERSION_INFO>
   <HOME_LIST>
      <HOME NAME="OraClient23Home1" LOC="/u01/app/oracle/product/cman/23.26" TYPE="O" IDX="21"/>
   </HOME_LIST>
   <COMPOSITEHOME_LIST/>

In this case, it's a Connection Manager, not a database client. Normal users will never see this name, but an Oracle DBA won't see which a special Oracle home is meant for, unless it's documented.

Changing the name is quite easy. First, detach the home:

# cd $ORACLE_HOME/oui/bin
# ./detachHome.sh
Starting Oracle Universal Installer...

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

Then, change the name in attachHome.sh:

#!/bin/sh
OHOME=/u01/app/oracle/product/cman/23.26
OHOMENAME=CMAN_23_26
CUR_DIR=`pwd`
cd $OHOME/oui/bin
./runInstaller -detachhome ORACLE_HOME=$OHOME ORACLE_HOME_NAME=$OHOMENAME $* > /dev/null 2>&1
./runInstaller -attachhome ORACLE_HOME=$OHOME ORACLE_HOME_NAME=$OHOMENAME $*
cd $CUR_DIR

After that, execute it:

# ./attachHome.sh
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 686 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
You can find the log of this install session at:
 /u01/app/oraInventory/logs/AttachHome2025-12-19_08-51-44AM.log
'AttachHome' was successful.

After that, the home is properly mentioned in inventory.xml:

<?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
<!-- Copyright (c) 1999, 2025, Oracle. All rights reserved. -->
<!-- Do not modify the contents of this file by hand. --><INVENTORY>
   <VERSION_INFO>
      <SAVED_WITH>13.9.4.0.0</SAVED_WITH>
      <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
   </VERSION_INFO>
   <HOME_LIST>
      <HOME NAME="CMAN_23_26" LOC="/u01/app/oracle/product/cman/23.26" TYPE="O" IDX="21"/>
   </HOME_LIST>
   <COMPOSITEHOME_LIST/>

Conclusion

This is a quite easy way to rename your Oracle Home. An you can do it online - no need to stop any service...

Subscribe to Martin's Blog

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe