7 Removing Oracle Real Application Clusters Software

This chapter describes how to completely remove all Oracle databases, instances, and software from an Oracle Real Application Clusters (Oracle RAC) Oracle home directory.

This chapter contains the following topics:

See Also:

The product-specific documentation, for example Oracle Database Client Installation Guide for Microsoft Windows, for information on removing a single product. Review the requirements and restrictions that apply for that product.

7.1 Overview of Deinstallation Procedures

To completely remove all Oracle databases, instances, and software from an Oracle home directory:

  • Identify all instances associated with the Oracle home

  • Shut down processes

  • Remove listeners installed in the Oracle Database home

  • Remove database instances

  • Remove Oracle Automatic Storage Management (Oracle ASM) release 11.1 or earlier

  • Remove Oracle Clusterware and Oracle ASM (Oracle Grid Infrastructure)

Note:

  • For information on removing Oracle Database Vault, see Oracle Database Vault Administrator's Guide.

  • For information on removing Oracle Configuration Manager, see Oracle Configuration Manager Installation and Administration Guide.

  • With Oracle Grid Infrastructure 11g release 2 (11.2) and later, Oracle ASM and Oracle Clusterware comprise the Oracle Grid Infrastructure installation. These components are installed and removed together.

Caution:

If any cluster member node has more than one database with the same global database name (GDN) on a server, then you cannot use the deinstallation tool to remove only one database. For example, if you have a standalone database on one of your cluster nodes with the GDN mydb.example.com, and your Oracle RAC database GDN is also mydb.example.com, then both databases on that node are removed by the deinstallation tool.

7.2 Identifying All Instances On a Cluster

You can identify the database instances on your cluster using either SRVCTL or the Windows Services control interface.

7.2.1 Identifying All Instances On a Cluster Using SRVCTL

To identify all instances associated with the Oracle home to remove, enter the following command, where dbname is the name of the database:

C:\..> srvctl status database -db dbname

7.2.2 Identifying All Instances On a Cluster Using the Windows Services Control Manager

You can identify all instances and services associated with the Oracle home that you want to remove by performing the following steps:

  1. Log in to a cluster node as a user with Administrator privileges.

  2. Locate the Oracle services related to the Oracle home.

    Use the Windows Services Control Manager to manage the services. Look for any Oracle services (their names begin with Ora) that access the Oracle home you are removing and have the status Started.

    To determine which Oracle home a service is associated with, check "Path to Executable" for a service to see the directory where the executable for the service is located.

7.3 Deinstalling Oracle RAC Software

The deinstallation tool removes Oracle Clusterware and Oracle Automatic Storage Management (Oracle ASM) from your server, and Oracle Database installations, for both Oracle RAC and single-instance databases. The following sections describe the deinstallation tool, and provide information about additional options you can use:

7.3.1 About the Deinstallation Tool

Starting with Oracle Database 12c, the deinstallation tool is integrated with the database installation media. You can run the deinstallation tool using the setup.exe command with the -deinstall and -home options from the base directory of the database, client or grid infrastructure installation media.

The deinstallation tool is also available as a separate command (deinstall.bat) in Oracle home directories after installation. It is located in the %ORACLE_HOME%\deinstall directory.

The deinstall.bat command uses the information you provide, plus information gathered from the software home to create a response file. You can alternatively supply a response file generated previously by the deinstall.bat command using the -checkonly and -o flags. You can also edit a response file template to create a response file.

The deinstallation tool (deinstall.bat) stops Oracle services, instances, and processes, and removes Oracle software and configuration files on the operating system for a specific Oracle home. If you run the deinstallation tool to remove an Oracle Grid Infrastructure for Windows installation, then the deinstaller automatically runs the appropriate scripts to deconfigure Oracle Grid Infrastructure or Oracle Grid Infrastructure for standalone server.

If the software in the Oracle home is not running (for example, after an unsuccessful installation), then the deinstallation tool cannot determine the configuration, and you must provide all the configuration details either interactively or in a response file.

Caution:

When you run the deinstallation tool, if the central inventory contains no other registered homes besides the home that you are deconfiguring and removing, then the deinstallation tool removes the following files and directory contents in the Oracle base directory of the Oracle Database installation owner:
  • admin

  • cfgtoollogs

  • checkpoints

  • diag

  • oradata

  • fast_recovery_area

Oracle strongly recommends that you configure your installations using an Optimal Flexible Architecture (OFA) configuration, and that you reserve Oracle base and Oracle home paths for exclusive use of Oracle software. If you have any user data in these locations in the Oracle base that is owned by the user account that owns the Oracle software, then the deinstallation tool deletes this data.

The default method for running the deinstallation tool is from the deinstall directory in the Oracle home as the installation owner:

C:\> cd %ORACLE_HOME%\deinstall
C:\..\dbhome_1\> deinstall.bat

The deinstall.bat command uses the following syntax, where variable content is indicated by italics:

deinstall.bat [-silent] [-checkonly] [-local]
 [-paramfile complete path of input response file] 
 [-params name1=value[ name2=value ...]] 
 [-o complete path of directory for saving files] 
 [ -tmpdir complete path of temporary directory to use]  [ -logdir complete path of log directory to use] [-help]
 

To run the deinstallation tool from the database installation media, use the setup.exe command with the -deinstall option, followed by the -home option to specify the path of the Oracle home you want to remove using the following syntax, where variable content is indicated in italics:

setup.exe -deinstall -home complete path of Oracle home [-silent] [-checkonly]
 [-local] [-paramfile complete path of input response file] 
 [-params name1=value[ name2=value ...]] 
 [-o complete path of directory for saving files] 
 [ -tmpdir complete path of temporary directory to use]  [ -logdir complete path of log directory to use] [-help]
 

Provide information about your servers as prompted or accept the defaults.

The deinstallation tool stops Oracle software, and removes Oracle software and configuration files on the operating system.

In addition, you can run the deinstallation tool with a response file, or select any of the following options when using deinstallation tool:

  • -home

    Use this flag to indicate the home path of the Oracle home to check or deinstall. To deinstall Oracle software using the deinstall.bat command located within the Oracle home being removed, provide a response file in a location outside the Oracle home, and do not use the -home flag.

    If you run deinstall.bat from the %ORACLE_HOME%\deinstall path, then the -home flag is not required because the tool knows from which home it is being run. If you use the command setup.exe -deinstall from the installation media, then the -home flag is mandatory.

  • -silent

    Use this flag to run the command in silent or response file mode. If you use the -silent flag, then you must use the -paramfile flag and provide a response file that contains the configuration values for the oracle home to deinstall or deconfigure.

    If you have a working system, then you can generate a response file to use or modify by running the deinstall.bat command with the -checkonly flag. The deinstall.bat command then discovers information from the Oracle home to deinstall and deconfigure. It generates the response file, which you can then use with the -silent option.

    You can also modify the template file deinstall.rsp.tmpl, located in the %ORACLE_HOME%\deinstall\response folder.

  • -checkonly

    Use this flag to check the status of the Oracle software home configuration. Running the deinstall.bat command with the -checkonly flag does not remove the Oracle configuration. The -checkonly flag generates a response file that you can use with the deinstall.bat command.

    When you run the deinstall.bat command with the -checkonly flag to generate a response file, you are prompted to provide information about your system. You can accept the default value the deinstallation tool has obtained from your Oracle installation, indicated inside brackets ([]), or you can provide different values. To accept the defaults, click Enter at each prompt.

  • -local

    Use this flag in a multinode environment to deinstall Oracle software on a local node of a cluster.

    When you run the deinstall.bat command with this flag, it deconfigures and deinstalls the Oracle software on the local node (the node on which you run the deinstall.bat command). On remote nodes, it deconfigures Oracle software, but does not deinstall the Oracle software.

    Note:

    You cannot use the deinstallation tool with the -local option for a shared Oracle home.
  • -paramfile complete path of input response file

    This is an optional flag. Use this flag to run the deinstall.bat command with a response file in a location other than the default. When you use this flag, provide the complete path where the response file is located. If you run the deinstall.bat command from the Oracle home that you plan to deinstall, then you do not need to use the -paramfile option.

    The default location of the response file depends on the location of the deinstall.bat command you use:

    Location of deinstall.bat Default Location of the Response File
    In the installation media or stage location: X:\staging_location\response

    where X:\staging_location refers to the directory that contains the installation software

    After installation, in the installed Oracle home %ORACLE_HOME%\deinstall\response

  • -params name1=value[ name2=value ...]

    Use this flag with a response file to override one or more values in a response file that you created.

  • -o complete path of directory for saving response files

    Use this flag to provide a path other than the default location where the response file (deinstall_Oracle_home_name.rsp) is saved.

    The default location of the response file depends on the location of the deinstallation tool:

    Location of deinstall.bat Default Location of the Response File
    In the installation media or stage location: X:\staging_location\response
    After installation, in the installed Oracle home %ORACLE_HOME%\deinstall\response

  • -tmpdir complete path of temporary directory

    Specifies a non-default location where Oracle Deinstallation Tool writes the temporary files for the deinstallation.

  • -logdir complete path of log directory

    Specifies a non-default location where Oracle Deinstallation Tool writes the log files for the deinstallation.

  • -help

    Use this flag (-help or -h) to obtain additional information about the command options and flags.

If you use the deinstall.bat command located in an Oracle home, then the command, by default, writes log files in the C:\Program Files\Oracle\Inventory\logs directory. If, however, you are removing the last Oracle home installed on the server, then, by default, the utility writes the log files to:

  • %TEMP%\deinstall\logs if you use the deinstall.bat command located in the Oracle home

  • %TEMP%\deinstall_bootstrap\log if you use the setup.exe -deinstall -home Oracle_home command

7.3.2 Example of Running the Deinstall Command for Oracle RAC

If you use the setup.exe -deinstall command to run the deinstallation tool, then you must provide the home directory of the Oracle software to remove from your system. You may be prompted for additional information required by the deinstallation tool.

If you run the setup.exe -deinstall command without additional parameters, then the usage information for the command is displayed.

If you run the deinstall.bat command from the %ORACLE_HOME%/deinstall folder, then deinstallation starts without prompting you for a home address.

Example 7-1 Running the Deinstallation Tool from the Installer

To remove the Oracle Database home dbhome_1 using the deinstallation tool started from the installer, use commands similar to the following while logged in as a member of the Administrator group, where directory_path is the path to the database directory on the installation media:

C:\> cd directory_path\
C:\database> setup.exe -deinstall -home C:\app\oracle\product\12.1.0\dbhome_1\

Example 7-2 Running the Deinstallation Tool with a Response File

In the following example, the runInstaller command is in the path /directory_path, where directory_path is the path to the database directory on the installation media. This example also uses a response file in the software owner location C:\user\oracle:

C:\> cd directory_path\
C:\..database> setup.exe -deinstall -paramfile C:\user\oracle\my_db_parmfile.tmpl

7.3.3 Example of a Deinstallation Response File for Oracle RAC

You can run the deinstallation tool on Oracle RAC Databases with the -paramfile option to use the values you specify in the response file. The following is an example of a response file used with the deinstallation tool.

Example 7-3 Sample Response File to use with the Deinstallation Tool to Uninstall Oracle RAC

The following is an example of a response file created by the deinstallation tool. The response file contains the following information:

  • The Oracle Home User is oracle

  • The Oracle Database home (Oracle home) is in the path C:\app\oracle\product\12.1.0\dbhome_1

  • The Oracle base is C:\app\oracle

  • The Grid home is C:\app\12.1.0\grid

  • The central Oracle Inventory home is C:\Program Files\Oracle\Inventory

  • The virtual IP address (VIP) is 192.0.2.1

  • The name of the local node (the node on which you run the deinstallation tool) is node1

  • The name of the remote node is node2

  • The database name is orcl and it is an Oracle RAC database

  • The database uses Oracle ASM for storage

#Copyright (c) 2005, 2010 Oracle Corporation. All rights reserved.
LOCAL_NODE=node1
HOME_TYPE=RACDB
ORACLE_BASE=C:\app\oracle
DB_TYPE.orcl=RAC_DB
silent=false
ORA_CRS_HOME=C:\app\12.1.0\grid\
LOGDIR=C:\Program Files\Oracle\Inventory\logs\
DATAFILE_LOC.orcl=
ORACLE_BINARY_OK=true
DUMP_DESTINATION_LOC.orcl=C:\app\oracle\admin\orcl
EMCP.DB_UNIQUE_NAME_LIST=orcl
CLUSTER_NODES=node1,node2
REMOTE_NODES=node2
SPFILE_LOC.orcl=+DATA/orcl/spfileorcl.ora
ARCHIVE_LOG_DESTINATION_LOC.orcl=
ORACLE_BASE.orcl=C:\app\oracle
LOCAL_SID.orcl=orcl1
local=false
INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory
NODE_LIST.orcl=node1,node2
RAW_MAPPING_FILE.orcl=
DIAG_DEST.orcl=C:\APP\ORACLE\diag\rdbms\orcl
ORACLE_HOME=C:\app\oracle\product\12.1.0\dbhome_1\
STORAGE_TYPE.orcl=ASM
CCR_CONFIG_STATUS=CCR_DEL_HOME
CRS_HOME=false
EMCP.CHECK_POINT.orcl=WINDOWS_SERVICE_REGISTRY_CREATE,DBCONTROL_START
CONFIGFILE_LOC.orcl=+DATA/orcl/controlfile/current.260.712754807,C:\APP\ORACLE
 \PRODUCT\12.1.0\DBHOME_1\DATABASE\DR1ORCL.DAT,C:\APP\ORACLE\PRODUCT\12.1.0\
 DBHOME_1\DATABASE\DR2ORCL.DAT
SID_LIST.orcl=orcl1,orcl2
OLD_ACTIVE_ORACLE_HOME=
CREATION_MODE.orcl=y
COMPS_TO_REMOVE=ode.net.ntoledb,oramts
DB_UNIQUE_NAME_LIST=orcl
FLASH_RECOVERY_LOC.orcl=