Note 1525025 - Oracle 11.2.0: Oracle Software Deinstallation

Summary
Symptom
Deinstallation of Oracle Database Software On Unix/Linux Platforms

In Oracle release 11.2 the procedure to deinstall Oracle Database software has changed. This note describes how to deinstall Oracle Database Software as of release 11.2.

This note is valid for UNIX / Linux platforms platforms. For Windows platforms see SAP note 1591580.

Other terms

Oracle Database 11g Release 2 (11.2)
Reason and Prerequisites
Deinstallation Tool

Starting release 11.2 Oracle ships a deinstallation tool "deinstall" to deinstall Oracle Database 11g Release 2 software. You can no longer use Oracle Universal Installer (OUI) to deinstall an Oracle home.

Attempting to deinstall/remove 11gR2 Oracle Database Software using the Oracle Universal Installer 11.2 fails with the following warning messages:


Please run the command '<ORACLE_HOME>/deinstall/deinstall' to deinstall this Oracle Home.
Oracle References
  • Oracle® Database Installation Guide for Linux:
    [http://download.oracle.com/docs/cd/E11882_01/install.112/e24321/remove_oracle_sw.htm#CEGBAJIA]
  • Oracle® Database Installation Guide for Microsoft Windows:
    [http://download.oracle.com/docs/cd/E11882_01/install.112/e16773/deinstall.htm#CIHDGGJJ]
  • MOS 883743.1
    How To Deinstall/Uninstall Oracle Home In 11gR2 [ID 883743.1]
  • My Oracle Support note 885609.1
  • My Oracle Support note 886184.1 - Oracle De-install Utility - 11g R2
  • Oracle Universal Installer and OPatch User's Guide 11g Release 2 for Windows and Unix

Solution
Recommendations for Deinstallation of 11.2 Oracle Homes
  • Back up the Central Inventory before you install, deinstall or clone an Oracle home, or before you attach an Oracle home to or detach an Oracle home from the Central Inventory.
  • Ensure that all configuration files needed from the Oracle home have been backed up and/or copied to the new/current Oracle home before you deinstall an Oracle home.
    Examples: init<SID>.ora/SPFILE, init<SID>.sap, tnsnames.ora, sqlnet.ora, listener.ora, password files, TDE encryption wallets
  • For deinstallation of database software of release 11.2.0.1 or 11.2.0.2 it is recommended not to use the deinstall tool of release 11.2.0.1 or 11.2.0.2 that is installed inside the Oracle home (see recommendation in MOS [ID 883743.1]).

    The deinstall tool is designed to deinstall Oracle software in an Oracle Flexibly Architecture (OFA) configuration. If you use the deinstall tool from release 11.2.0.1 or 11.2.0.2 in an SAP environment, the deinstall tool might not only delete the software from the Oracle home, but also other files and directories located under <ORACLE_BASE> (including database files and 'sap%' directories).
  • Starting 11.2.0.3 you can use the deinstall tool to deinstall Oracle homes.

    Warning: If the Oracle home that you are going to remove is the last Oracle home that is registered in the central inventory the deinstall tool will remove all files and directories under $ORACLE_BASE (including all database files in sapdata* directories and other files in sap* directories).

    [http://download.oracle.com/docs/cd/E11882_01/install.112/e24321/remove_oracle_sw.htm#sthref710]

Deinstallation Using the External Deinstall Utility


There are 2 methods to remove Oracle database software (see MOS [ID 883743.1]):
    1. External Deinstall utility (recommended)
    2. Deinstall script located inside Oracle Home

In order to deinstall Oracle homes of release 11.2.0.1 or 11.2.0.2 you should use the latest version of the 11.2 external deinstall utility (11.2.0.3 or higher).

The external 11.2.0.3 deinstall utility can be downloaded here:
  • from Oracle Technology Network (OTN)
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
  • from SAP Software Download Center (SWDC)
    http://service.sap.com/oracle
    As part of "ORACLE RDBMS Release 11.2.0.3" DVDs
    See SAP note 1431799.

De-installing Oracle Home using external de-install utility
    1. Download and unzip de-install utility in some folder outside Oracle Home (example: <SAPDATA_HOME>/<release>.deinstall_tool

    Example:
    /oracle/C11/11203.deinstall_tool
    2. Go to the deinstall folder and invoke the deinstall utility with the -home option specifying the full path of the Oracle Home you want to deinstall.

    Example:
    OS> cd /oracle/C11/11203.deinstall_tool
    OS> ./deinstall -home /oracle/C11/11202 [-checkonly]
Deinstallation of Database Software of Release 11.2.0.3

For deinstallation of an 11.2.0.3 Oracle home you should use the deinstall tool.

The deinstallation tool is located inside of an Oracle home at '<ORACLE_HOME>/deinstall/deinstall'.

By default, 11.2.0.3 database software is installed in '/oracle/$DB_SID/11203' and registered with this path in the central inventory. After you installed a newer patch set release into a new Oracle home and upgraded the database to the new release, you can use the following method to remove the Oracle Database 11.2.0.3 software:
    1. For help on deinstall tool run the following command:

    OS> <ORACLE_HOME_TO_DELETE>/deinstall/deinstall -help
    2. Run deinstall in 'check-only' mode

    OS> cd <ORACLE_HOME_TO_DELETE>/deinstall
    OS> ./deinstall -checkonly

    Verify from the output which Oracle home is going to be deleted.

    In order to not delete any databases it is important that you do not specify a database name when asked in the following dialog: "Specify the list of database names that are configured in this Oracle home []:"

    In the 'CHECK OPERATION SUMMARY' section verify that the deinstallation targets are correct. If you are satisfied with the result, then go to the next step to deinstall the software.
    3. Deinstall the software

    OS> ./deinstall

    To start the deinstallation, answer the following dialog with 'y', otherwise with 'n'.
    "Do you want to continue (y - yes, n - no)? [n]:"

    The following messages should be reported:
    "Successfully detached Oracle home '<ORACLE_HOME_TO_DELETE>' from the central inventory on the local node.
    Successfully deleted directory '<ORACLE_HOME_TO_DELETE>' on the local node.
    4. Change the current directory to the users home directory.

Deinstallation of Database Software of Release 11.2.0.2

To deinstall database software of release 11.2.0.2 you should not use the 11.2.0.2 deinstall tool.

By default, 11.2.0.2 database software is installed in '/oracle/$DB_SID/11202' and registered with this path in the central inventory. After you installed a newer patch set release into a new Oracle home and upgraded the database to the new release, you can use the following method to remove the Oracle Database 11.2.0.2 software:
    1. Check installed Oracle homes

    OS> $ORACLE_HOME/OPatch/opatch lsinventory -all

    You should see an entry for the 11.2.0.2 Oracle home like '/oracle/$DB_SID/11202'.
    2. Detach the old 11.2.0.2 Oracle home from Central Oracle Inventory

    OS> cd /oracle/$DB_SID/11202/oui/bin
    OS> ./detachHome.sh
    3. Delete the old 11.2.0.2 software

    OS> cd /oracle/$DB_SID
    OS> rm -rf 11202
Deinstallation of Database Software of Release 11.2.0.1

To deinstall database software of release 11.2.0.1 you should not use the 11.2.0.1 deinstall tool.

By default, 11.2.0.1 database software is installed in '/oracle/$DB_SID/112_64' and registered with this path in the central inventory. After you installed a newer patch set release into a new Oracle home, you can use the following method to remove Oracle Database 11.2.0.1 software:
    1. Check installed Oracle homes

    OS> $ORACLE_HOME/OPatch/opatch lsinventory -all

    You should see an entry for the 11.2.0.1 Oracle home like '/oracle/$DB_SID/112_64'.
    2. You should detach the 11.2.0.1 Oracle home '$ORACLE_HOME' from the Central Oracle Inventory before the database upgrade.

    OS> cd $ORACLE_HOME/oui/bin
    OS> ./detachHome.sh

    This will only deregister the Oracle home '$ORACLE_HOME' from the central inventory. You still can run the database instance from this Oracle home (for the upgrade).
    3. After the database has been upgraded to the new Oracle home, rename the directory '112_64' to '112_64.11201'.

    OS> cd /oracle/$DB_SID
    OS> mv 112_64 112_64.11201
    4. Detach the old 11.2.0.1 Oracle home from Central Oracle Inventory (if not already done before)

    Note that the following detach-command will re-create a directory '/oracle/$DB_SID/112_64' with several files and subdirectories in it. In order to avoid that during this action files and updates are written into your new Oracle home, you must stop the instance and temporarily remove the symbolic link /oracle/$DB_SID/112_64.
      a) Stop the instance.
      b) Remove symbolic link
      OS> cd /oracle/$DB_SID
      OS> rm 112_64
      c) Detach Oracle home
      OS> cd /oracle/$DB_SID/112_64.11201/oui/bin
      OS> ./detachHome.sh
      d) Recreate the symbolic link
      OS> cd /oracle/$DB_SID
      OS> mv 112_64 112_64.11201.detach
      OS> ln -s <directory of current Oracle home> 112_64
    5. Delete the old 11.2.0.1 software

    OS> cd /oracle/$DB_SID
    OS> rm -rf 112_64.11201

Appendix

Checking which Oracle homes are registered in the Central Oracle Inventory

With '<ORACLE_HOME>/OPatch/opatch lsinventory -all' you get a list of Oracle homes that are currently registered in the Central Oracle Inventory.

If the Oracle home from which you started OPatch is registered, this Oracle home is listed in the opatch output under 'List of Oracle Homes'.

Example: DB_SID=QO1


...
List of Oracle Homes:
  Name          Location
  QO1_102_64    /oracle/QO1/102_64
  OraDb_home1   /oracle/QO1/11202
...



If the Oracle home is not registered, opatch fails to load the inventory information and reports the following error:


...
Inventory load failed... OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
   Oracle Home dir. path does not exist in Central Inventory
   Oracle Home is a symbolic link
  Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

OPatch failed with error code 73


Detaching an Oracle home from the Central Oracle Inventory

OS> <ORACLE_HOME>/oui/bin/detachHome.sh  (Unix/Linux)

Attaching an Oracle home to the Central Oracle Inventory


OS> <ORACLE_HOME>/oui/bin/attachHome.sh  (Unix/Linux)




Header Data


Release Status:Released for Customer
Released on:18.04.2013  14:51:41
Master Language:English
Priority:Recommendations/additional info
Category:Installation information
Primary Component:BC-DB-ORA Oracle
Affected Releases
Release-Independent
Related Notes


 
1591580 - Oracle 11.2.0: Oracle Home administration on Windows
 
1524205 - Oracle 11.2.0: Database Software Installation

No comments: