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 removing a single product to ensure that you are aware of requirements and restrictions that apply for that productTo 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 Release 1 (11.1) or earlier
Remove Oracle Clusterware and Oracle Automatic Storage Management (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 Release 11.2 and later, Oracle Automatic Storage Management 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 deinstall tool to remove one database only. For example, if you have a standalone database on one of your cluster nodes with the GDNmydb.example.com
, and your Oracle RAC database GDN is also mydb.example.com
, then both databases on that node are removed.To identify all instances associated with the Oracle home to remove, enter the following command, where dbname
is the name of the database:
$ srvctl status database -d dbname
Alternately, you can check for registered instances by viewing the oratab
file:
AIX, HP-UX, or Linux:
$ more /etc/oratab
Oracle Solaris:
$ more /var/opt/oracle/oratab
The output of this command contains entries similar to the following:
+ASM1:/u01/app/12.1.0/grid:N CUST:/u01/app/oracle/product/12.1.0/dbhome_1:N
These entries show that the +ASM
Oracle Automatic Storage Management instance in the Oracle Grid Infrastructure for a cluster home (/u01/app/12.1.0/grid
) and the CUST
Oracle database instance are associated with the Oracle home directory /u01/app/oracle/product/12.1.0/dbhome_1
.
The Deinstallation Tool removes Oracle Clusterware and Oracle Automatic Storage Management (Oracle ASM) from your server, and Oracle Real Application Clusters (Oracle RAC) or standalone Oracle Database installations. The following sections describe the script, and provide information about additional options to use the 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 database, client or 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 parameter file. You can alternatively supply a parameter 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 Oracle Grid Infrastructure, then the deinstaller prompts you to run the rootcrs.sh
script, as the root
user, to deconfigure Oracle Grid Infrastructure or roothas.sh
script to deconfigure Oracle Grid Infrastructure for standalone server.
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.
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] [-local] [-paramfile complete path of input response file] [-params name1=value name2=value . . .] [-o complete path of directory for saving files] [-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 to remove using the following syntax, where variable content is indicated in italics:
runInstaller -deinstall -home complete path of Oracle home [-silent] [-checkonly] [-local] [-paramfile complete path of input parameter property file] [-params name1=value name2=value . . .] [-o complete path of directory for saving files] [-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 parameter 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 in the Oracle home you plan to deinstall, provide a parameter file in another location, and do not use the -home
flag.
If you run deinstall
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 standalone version of the tool or runInstaller -deinstall
from the installation media, then -home
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 parameter file that contains the configuration values for the Oracle home to deinstall or deconfigure.
You can generate a parameter file to use or modify by running deinstall
with the -checkonly
flag. The deinstall
command then discovers information from the Oracle home to deinstall and deconfigure. It generates the properties 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
command with the -checkonly
flag does not remove the Oracle configuration. The -checkonly
flag generates a parameter file which you can then use with the deinstall
command and -silent
option.
-local
Use this flag on a multinode environment to deinstall Oracle software in a cluster.
When you run deinstall
with this flag, it deconfigures and deinstalls the Oracle software on the local node (the node where deinstall
is run). On remote nodes, it deconfigures Oracle software, but does not deinstall the Oracle software.
-paramfile
complete path of input parameter property file
Use this flag to run deinstall
with a parameter file in a location other than the default. When you use this flag, provide the complete path where the parameter file is located.
The default location of the parameter file depends on the location of deinstall
:
From the installation media or stage location: $ORACLE_HOME/inventory/response
From a unzipped archive file from Oracle Technology Network: /
ziplocation
/response
After installation from the installed Oracle home: $ORACLE_HOME/deinstall/response
-params
[name1
=value
name 2
=value
name3
=value
. . .]
Use this flag with a parameter file to override one or more values to change in a parameter 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 properties file (deinstall.rsp.tmpl
) is saved.
The default location of the parameter file depends on the location of deinstall
:
From the installation media or stage location before installation: $ORACLE_HOME/
From a unzipped archive file from Oracle Technology Network: /
ziplocation
/response/
After installation from the installed Oracle home: $ORACLE_HOME/deinstall/response
-help
Use the help option (-help
) to get additional information about the command option flags.
If you run the deinstallation tool using the deinstall command from the $ORACLE_HOME/deinstall
folder, then the deinstallation starts without prompting you for an ORACLE_HOME.
Use the optional flag -paramfile
to provide a path to a parameter 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 to remove:
$ cd /directory_path/runInstaller
$ ./runInstaller -deinstall -home /u01/app/oracle/product/12.1.0/dbhome_1/
The following example uses a parameter file in the software owner location /home/usr/oracle
:
$ cd /directory_path/runInstaller
$ ./runInstaller -deinstall -paramfile /home/usr/oracle/my_db_paramfile.tmpl
You can run the deinstallation tool on Oracle RAC Databases with the -paramfile
option to use the values you specify in the parameter file. The following is an example of a parameter 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, 2006 Oracle Corporation. All rights reserved. #Mon Feb 17 06:48:39 UTC 2014 DISK_GROUPS.sidb= ASM_HOME= ASM_LOCAL_SID= LOGDIR=/u01/app/oracle/product/12.1.0/dbhome_1/oraInventory/logs/ ORACLE_BASE.sidb=/u01/app/oracle/ RECOVERY_LOC.sidb= STORAGE_TYPE.sidb=FS ORACLE_BASE=/u01/app/oracle/ INVENTORY_LOCATION=/u01/app/oraInventory DB_TYPE.sidb=SI_DB NODE_LIST.sidb=myserver ARCHIVE_LOG_DESTINATION_LOC.sidb= LOCAL_SID.sidb=sidb DB_UNIQUE_NAME_LIST=sidb ASM_FILES.sidb= HOME_TYPE=SIDB CRS_HOME=false RAW_MAPPING_FILE.sidb= SID_LIST.sidb=sidb ORACLE_BINARY_OK=true DATAFILE_LOC.sidb=/u01/app/oracle/oradata local=false LOCAL_NODE=myserver CREATION_MODE.sidb=y CONFIGFILE_LOC.sidb= DIAG_DEST.sidb=/u01/app/oracle/ silent=false ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1/ SPFILE_LOC.sidb=