The Application DBA  

Attaching and Detaching Oracle Homes

Introduction

The following details steps to manage Oracle homes while cloning. Specifically attaching and detaching Oracle homes from the central inventory and converting an Oracle home to RAC and single instance.

Attach an Oracle Home

The clone script may fail to attach the Oracle home properly. This can be checked by verifying the inventory.xml file in the oraInventory/ContentsXML directory. If this is the case then the Oracle home can be attached from the primary node with the following run as oracle:

$ORACLE_HOME/oui/bin/runInstaller -attachHome ORACLE_HOME_NAME="OraDb11g_home2" \
ORACLE_HOME="/u01/app/local/oracle/product/11.2.0/db_2" \
"CLUSTER_NODES={node1,node2}" \
LOCAL_NODE="node1"

Check inventory file:

cat /u01/app/oraInventory/ContentsXML/inventory.xml
cat $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml

Update any Oracle home entries in the oratab file.

Detach an Oracle Home

To detach an Oracle home run the following from the primary node as oracle:

$ORACLE_HOME/oui/bin/runInstaller –silent -detachHome -invPrtLoc ./oraInst.loc \
ORACLE_HOME_NAME="OraDb11g_home2" \
ORACLE_HOME="/u01/app/local/oracle/product/11.2.0/db_2"

After some errors with the runInstaller, Oracle support recommended:

Detach the Oracle Home using the below command:

./runInstaller -silent -detachHome ORACLE_HOME="<Oracle_Home_Location>"


Refer the following note for more information on the same: Oracle Universal Installer (OUI) FAQ (Doc ID 458893.1)

./runInstaller -silent -detachHome ORACLE_HOME="<Oracle_Home_Location>" ORACLE_HOME_NAME="<Name_Of_Oracle_Home>"

$ORACLE_HOME/oui/bin/runInstaller -silent -detachHome \
ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_2" \
ORACLE_HOME_NAME="OraDb11g_home2"

Check inventory file:

cat /u01/app/oraInventory/ContentsXML/inventory.xml

Remove any Oracle home entries in  the oratab file.

Remove an Oracle Home

How to remove / de-install / uninstall an existing Oracle home using OUI:

For versions prior to 11.2:

  • Invoke Oracle Universal Installer
  • Click De-install Products.
  • At the Inventory dialog, select the home(s) you wish to delete.
  • Click Remove.

For versions 11.2 and above you MUST use the deinstall utility.  This is described in the 11.2 Install and OUI guides.  Although you may find that the $ORACLE_HOME/oui/bin may present the options for a deinstall as discussed for versions prior to 11.2 this WILL NOT be supported per the following internal bugs:

  • For 10.1, 10.2, 11.1 OUI, you may also use the REMOVE_HOMES variable in the command line.
  • The syntax is as follows (OUI 10.2 e.g.):

./runInstaller -deinstall REMOVE_HOMES={"<LOCATION_OF_ORACLE_HOME_TO_BE_REMOVED>"} -silent

$ORACLE_HOME/oui/bin/runInstaller -deinstall \
REMOVE_HOMES={"/u01/app/oracle/product/11.2.0/db_2"} -silent

Single Instance Oracle Home

Converting an Oracle home to single instance:

  • Change the directory to the lib subdirectory in the rdbms directory under the Oracle home.
  • Relink the oracle binary by executing the following commands:

make -f ins_rdbms.mk rac_off
make -f ins_rdbms.mk ioracle

References

Oracle® Real Application Clusters Administration and Deployment Guide, 11g Release 2 (11.2)

Oracle® Universal Installer and OPatch User's Guide, 11g Release 2 (11.2) for Windows and UNIX

 

Copyright 1998-2013 AppsDBA Consulting. All Rights Reserved.