10 Removing Oracle Database Software

This chapter describes how to completely remove Oracle software and configuration files related to the specified Oracle home. It includes information about removing Oracle software using the deinstallation tool.

The deinstallation tool removes standalone Oracle Database installations, Oracle Clusterware and Oracle Automatic Storage Management (Oracle ASM) from your server, and also Oracle Real Application Clusters (Oracle RAC) and Oracle Database client installations.

Oracle recommends that you use the deinstallation tool to remove the entire Oracle home associated with the Oracle Database, Oracle Clusterware, Oracle ASM, Oracle RAC, or Oracle Database client installation. Oracle does not support the removal of individual products or components.

The following sections describe the deinstallation tools, and provide information about additional options to use the tool:

Caution:

If you have a standalone database on a node in a cluster and you have multiple databases with the same global database name (GDN), then you cannot use the deinstall tool to remove one database only.

See Also:

10.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 runInstaller command with the -deinstall and -home options from the base directory of the Oracle Database, Oracle Database Client or Oracle Grid Infrastructure installation media.

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

The deinstallation tool 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 command using the –checkonly option, or by editing the response file template.

The deinstallation tool stops Oracle software, 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 installation, then the deinstaller prompts you to run the roothas.sh script, as the root user, to deconfigure Oracle Restart.

Note:

Starting with Oracle Database 12c Release 1 (12.1.0.2), the roothas.sh script replaces the roothas.pl script in the Oracle Grid Infrastructure home.

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 (oraInventory) contains no other registered homes besides the home that you are deconfiguring and removing, then the deinstall command 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.

In addition, for Oracle Grid Infrastructure installations:

  • Oracle Automatic Storage Management Cluster File System (Oracle ACFS) must be dismounted and Oracle Automatic Storage Management Dynamic Volume Manager (Oracle ADVM) must be disabled.

  • If Grid Naming Service (GNS) is in use, then the entry for the subdomain must be deleted from DNS by your DNS administrator.

The deinstallation tool deletes Oracle Database configuration files, user data, and fast recovery area (FRA) files even if they are located outside of the Oracle base directory path.

Oracle recommends that you run the deinstallation tool as the Oracle software installation owner. The default method for running the deinstallation tool is from the deinstall directory in the Oracle home as the installation owner:

$ $ORACLE_HOME/deinstall/deinstall

The deinstall command uses the following syntax, where variable content is indicated in italics:

./deinstall [-silent] [-checkonly] [-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 runInstaller 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:

./runInstaller -deinstall -home complete path of Oracle home [-silent] [-checkonly] [-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 the following options to run the 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 command, located in the Oracle home you plan to deinstall, provide a response file located outside the Oracle home, and do not use the -home flag.

    If you run the deinstallation tool from the $ORACLE_HOME/deinstall path, then the -home flag is not required because the tool identifies the location of the home where it is run. If you use runInstaller -deinstall from the installation media, then -home is mandatory.

  • -silent

    Use this flag to run the deinstallation tool in noninteractive mode. This option requires one of the following:

    • A working system that it can access to determine the installation and configuration information. The -silent flag does not work with failed installations.

    • A response file that contains the configuration values for the Oracle home that is being deinstalled or deconfigured.

    You can generate a response file to use or modify by running the tool with the -checkonly flag. The tool then discovers information from the Oracle home to deinstall and deconfigure. It generates the response file that 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 directory.

  • -checkonly

    Use this flag to check the status of the Oracle software home configuration. Running the deinstallation tool with the -checkonly flag does not remove the Oracle configuration. The -checkonly flag generates a response file that you can use with the deinstallation tool and -silent option.

  • -paramfile complete path of input response file

    Use this flag to run the deinstallation tool 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.

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

    • From the installation media or stage location: /response

    • After installation from the installed Oracle home: $ORACLE_HOME/deinstall/response

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

    Use this flag with a response file to override one or more values to change in a response file you have 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.rsp.tmpl) is saved.

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

    • From the installation media or stage location: /response

    • After installation from the installed Oracle home: $ORACLE_HOME/deinstall/response

  • -tmpdir complete path of temporary directory

    Use this flag to specify a non-default location where Oracle Deinstallation Tool writes the temporary files for the deinstallation.

  • -logdir complete path of log directory

    Use this flag to specify a non-default location where Oracle Deinstallation Tool writes the log files for the deinstallation.

  • -help

    Use the help option (-help) to get additional information about the command option flags.

See Also:

Oracle Real Application Clusters Installation Guide for Linux and UNIX for information about the -local option

10.1.1 Deinstalling Previous Release Grid Home

For upgrades from previous releases, if you want to deinstall the previous release Grid home, then as the root user, you must manually change the permissions of the previous release Grid home, and then run the deinstall command.

For example:

# chown -R grid:oinstall /u01/app/grid/11.2.0
# chmod -R 775 /u01/app/grid/11.2.0

In this example, /u01/app/grid/11.2.0 is the previous release Grid home.

10.2 Example of Running the Deinstallation Tool

If you run the deinstallation tool using the runInstaller command with the -deinstall option from the installation media, then help is displayed unless you enter a -home flag and provide a path to the home directory of the Oracle software to remove from your system.

Use the optional flag -paramfile to provide a path to 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, and /u01/app/oracle/product/12.1.0/dbhome_1/ is the path to the Oracle home remove:

$ cd /directory_path/
$ ./runInstaller -deinstall -home /u01/app/oracle/product/12.1.0/dbhome_1/

The following example uses a response file in the software owner location /home/usr/oracle:

$ cd /directory_path/
$ ./runInstaller -deinstall -paramfile /home/usr/oracle/my_db_paramfile.tmpl

10.3 Example of Running the Deinstall Command

If you run the deinstallation tool using the deinstall command from the $ORACLE_HOME/deinstall directory, then the deinstallation starts without prompting you for the Oracle home path.

Use the optional flag -paramfile to provide a path to a response file.

In the following example, the deinstall command is in the path /u01/app/oracle/product/12.1.0/dbhome_1/deinstall, and it uses a response file in the software owner location /home/usr/oracle:

$ cd /u01/app/oracle/product/12.1.0/dbhome_1/deinstall
$ ./deinstall -paramfile /home/usr/oracle/my_db_paramfile.tmpl

For the Oracle Grid Infrastructure home, use the deinstallation script in the Oracle Grid Infrastructure for a standalone server home, which in this example is /u01/app/oracle/product/12.1.0/grid:

$ cd /u01/app/oracle/product/12.1.0/grid/deinstall
$ ./deinstall -paramfile /home/usr/oracle/my_grid_paramfile.tmpl

10.4 Deinstallation Response File Example for Oracle Database

You can run the deinstallation tool with the -paramfile option to use the values you specify in the response file. The following is an example of a response file, in which the Oracle Database binary owner is oracle, the Oracle Database home (Oracle home) is in the path /u01/app/oracle/product/12.1.0/dbhome_1/, the Oracle base (where other Oracle software is installed) is /u01/app/oracle/, the central Oracle Inventory home (oraInventory) is /u01/app/oraInventory, the virtual IP address (VIP) is 192.0.2.1, the local node (the node where you run the deinstallation session from) is myserver, and the OSDBA group is dba:

# Copyright (c) 2005, 2009 Oracle Corporation.  All rights reserved.
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
ORACLE_BASE.orcl=/u01/app/oracle
FAST_RECOVERY_LOC.orcl=/u01/app/oracle/fast_recovery_area/ORCL
STORAGE_TYPE.orcl=FS
DB_TYPE.orcl=SI_DB
NETCA_LOCAL_LISTENERS=LISTENER
LOGDIR=/u01/app/oraInventory/logs/
NODE_LIST.orcl=myserver
ObaseCleanupPtrLoc=/tmp/deinstall2012-06-12_09-14-11AM/orabase_cleanup.lst
ARCHIVE_LOG_DESTINATION_LOC.orcl=
ORACLE_BASE=/u01/app/oracle
DUMP_DESTINATION_LOC.orcl=/u01/app/oracle/admin/orcl
LOCAL_SID.orcl=orcl
INVENTORY_LOCATION=/u01/app/oraInventory
RAW_MAPPING_FILE.orcl=
SID_LIST.orcl=orcl
DB_UNIQUE_NAME_LIST=orcl
DATAFILE_LOC.orcl=/u01/app/oracle/oradata/orcl,/u01/app/oracle/fast_recovery_area/orcl
HOME_TYPE=SIDB
CRS_HOME=false
CREATION_MODE.orcl=y
CONFIGFILE_LOC.orcl=
ORACLE_BINARY_OK=true
DIAG_DEST.orcl=/u01/app/oracle/diag/rdbms/orcl
LOCAL_NODE=myserver
local=false
SPFILE_LOC.orcl=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfileorcl.ora
inst_group=dba
inventory_loc=/u01/app/oraInventory
MinimumSupportedVersion=11.2.0.1.0
silent=false
DBCA_LOG.orcl=/u01/app/oracle/cfgtoollogs/dbca/orcl
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
CCR_CONFIG_STATUS=CCR_DEL_HOME
EMCA_LOG.orcl=/u01/app/oracle/cfgtoollogs/emca/orcl
ORACLE_HOME_VERSION_VALID=true

10.5 Deinstallation Response File Example for Oracle Grid Infrastructure

You can run the deinstallation tool with the -paramfile option to use the values you specify in the response file.

The following is an example of a response file, in which the Oracle Grid Infrastructure binary owner is oracle, the Oracle Grid Infrastructure home is in the path /u01/app/oracle/product/12.1.0/grid, the Oracle base (where other Oracle software is installed) is /u01/app/oracle/, the central Oracle Inventory home (oraInventory) is /u01/app/oraInventory, the local node (the node where you run the deinstallation session from) is myserver, and the OSDBA group is dba:

# Copyright (c) 2005, 2009 Oracle Corporation.  All rights reserved.
ORACLE_HOME=/u01/app/oracle/product/12.1.0/grid
LOCAL_NODE=myserver
HOME_TYPE=SIHA
ASM_REDUNDANCY=EXTERNAL
ORACLE_BASE=/u01/app/oracle/
ObaseCleanupPtrLoc=/tmp/deinstall_bootstrap/orabase_cleanup.lst
SCAN_PORT=0
silent=false
ASM_UPGRADE=false
ORA_CRS_HOME=/u01/app/oracle/product/12.1.0/grid
MinimumSupportedVersion=11.2.0.1.0
GPNPCONFIGDIR=$ORACLE_HOME
LOGDIR=/u01/app/oraInventory/logs/
ORACLE_HOME_VERSION_VALID=true
ASM_DISCOVERY_STRING=/scratch/raw/raw*
GPNPGCONFIGDIR=$ORACLE_HOME
ORACLE_OWNER=oracle
ISROLLING=true
ASM_DISKSTRING=/scratch/raw/raw*
CRS_STORAGE_OPTION=0
ORACLE_BINARY_OK=true
MGMT_DB=false
NETCA_LISTENERS_REGISTERED_WITH_HAS=LISTENER
inst_group=svrtech
ASM_AU_SIZE=1
HUB_SIZE=0
ASM_ORACLE_BASE=/u01/app/oracle
ORA_DBA_GROUP=dba
JREDIR=/u01/app/oracle/product/12.1.0/grid/jdk/jre/
USER_IGNORED_PREREQ=false
inventory_loc=/u01/app/oraInventory
ASM_DISK_GROUPS="+DATA"
ORA_ASM_GROUP=dba
LANGUAGE_ID=AMERICAN_AMERICA.AL32UTF8
CSS_LEASEDURATION=400
ASM_HOME=/u01/app/oracle/product/12.1.0/grid
ASM_DIAGNOSTIC_DEST=/u01/app/oracle/product/OB
TZ=PST8PDT
REUSEDG=false
SILENT=false
local=false
INVENTORY_LOCATION=/u01/app/oraInventory
GNS_CONF=false
BIG_CLUSTER=false
ASM_DISKS=/scratch/raw/raw1,/scratch/raw/raw2,/scratch/raw/raw3,/scratch/raw/raw4,/scratch/raw/raw5,/scratch/raw/raw6,/scratch/raw/raw7,/scratch/raw/raw8
ORACLE_HOME=/u01/app/oracle/product/12.1.0/grid
CRS_HOME=true
ASM_IN_HOME=true
CRFHOME="/u01/app/oracle/product/12.1.0/grid"
ASM_DROP_DISKGROUPS=true
ASM_LOCAL_SID=+ASM
JLIBDIR=/u01/app/oracle/product/12.1.0/grid/jlib
VNDR_CLUSTER=false
ASM_DISK_GROUP=DATA