9 Modifying or Deinstalling Oracle Grid Infrastructure

You must follow a specific procedure when modifying or removing Oracle Clusterware and Oracle Automatic Storage Management (Oracle ASM) software.

See Also:

Product-specific documentation for requirements and restrictions to remove an individual product

9.1 Deciding When to Deinstall Oracle Clusterware

There are certain situations in which you might be required to remove Oracle software.

Remove installed components in the following situations:

  • You have successfully installed Oracle Clusterware, and you want to remove the Oracle Clusterware installation, either in an educational environment, or a test environment.

  • You have encountered errors during or after installing or upgrading Oracle Clusterware, and you want to reattempt an installation.

  • Your installation or upgrade stopped because of a hardware or operating system failure.

  • You are advised by Oracle Support to reinstall Oracle Clusterware.

9.2 Migrating Standalone Grid Infrastructure Servers to a Cluster

If you have an Oracle Database installation using Oracle Restart (an Oracle Grid Infrastructure installation for a standalone server), you can reconfigure that server as a cluster member node.

  1. Inspect the Oracle Restart configuration with the Server Control (SRVCTL) utility using the following syntax, where db_unique_name is the unique name for the database, and lsnrname is the name of the listener for the database:
    srvctl config database -db db_unique_name
    srvctl config service -db db_unique_name
    srvctl config listener -listener lsnrname
    
    Write down the configuration information for the server; you will need this information in a later step.
  2. Stop all of the databases, services, and listeners that you discovered in step 1.
  3. If present, unmount all Oracle Automatic Storage Management Cluster File System (Oracle ACFS) file systems.
  4. Go to the directory Grid_home\crs\install, where Grid_home is the location of your Oracle Grid Infrastructure home (Grid home) directory, for example:
    C:\> cd app\12.1.0\grid\crs\install
    
  5. Deconfigure and deinstall the Oracle Grid Infrastructure installation for a standalone server (Oracle Restart) using the following command:
    C:\..\install> perl roothas.bat -deconfig -force
    
  6. Prepare the server for Oracle Clusterware configuration, as described in Chapter 2 through Chapter 6 of this guide. In addition, choose to install Oracle Grid Infrastructure for a cluster in the same location as Oracle Restart or in a different location:
    Option Description
    Installing in the Same Location as Oracle Restart
    1. Use the deinstallation tool to remove the Oracle Restart software, but with all disk groups intact.

    2. Proceed to step 7.

    Installing in a Different Location than Oracle Restart Install Oracle Grid Infrastructure for a cluster in the new Grid home software location.
  7. As the Oracle Installation user for Oracle Grid Infrastructure, run Oracle Clusterware Configuration Wizard, and save and stage the response file. For the -responseFile parameter, specify the full path name where the response file should be written by the Oracle Clusterware Configuration Wizard, for example:
    C:\> cd Grid_home\crs\config
    C:\..\config> config.bat -silent -responseFile C:\Users\dba1\scripts\GI.rsp
    
  8. Mount the Oracle ASM disk group used by Oracle Restart.
  9. If you used Oracle ACFS with Oracle Restart, then:
    1. Start Oracle ASM Configuration Assistant (ASMCA). Run the volenable command to enable all Oracle Restart disk group volumes.
    2. Mount all Oracle ACFS file systems manually.
  10. Add back Oracle Clusterware services to the Oracle Clusterware home, using the information you wrote down in step 1, including adding back Oracle ACFS resources, by performing the following tasks:
    1. Register the Oracle ACFS resources using a command similar to the following, where Grid_home is the location of your Oracle Grid Infrastructure installation:
      C:\> Grid_home\bin\srvctl add filesystem -device \\.\ORCLDATADISK4
      -diskgroup ORestartData -volume db1 
      -mountpointpath C:\app\12.1.0\grid\db1 -user grid
      
    2. Add the Oracle Database for support by Oracle Grid Infrastructure for a cluster. Use the following command syntax, where db_unique_name is the unique name of the database on the node, and nodename is the name of the node:
      srvctl add database -db db_unique_name -oraclehome %ORACLE_HOME% -node
      nodename
      
      For example, for the database name mydb on the local node node1, first verify that the ORACLE_HOME environment variable is set to the location of the database home directory, then enter the following command to register the database with Oracle Clusterware:
      srvctl add database -db mydb -oraclehome %ORACLE_HOME% -node node1
      
    3. Register each database service, using the command srvctl add service. For example, if your database name is mydb and you created a service named myservice for this database, then enter the following command:
      srvctl add service -db mydb -service myservice
      

      See Also:

      Oracle Clusterware Administration and Deployment Guide for more information about the configuration wizard.

9.3 Changing the Oracle Grid Infrastructure Home Path

You must reconfigure Oracle Clusterware and Oracle ASM every time you move the Grid home.

Caution:

Before changing the Grid home, you must shut down all executables that run in the Grid home directory that you are modifying. In addition, shut down all applications that use Oracle shared libraries.
  1. Login as an Administrator user or the Oracle Installation user for Oracle Grid Infrastructure (for example, grid).
  2. Change directory to Grid_home\bin and enter the command crsctl stop crs. For example:
    C:\> cd app\12.1.0\grid\BIN
    C:\..\BIN> crsctl stop crs
    
  3. Detach the existing Grid home.
    Run a command similar to the following command, where C:\app\12.1.0\grid is the existing Grid home location:
    C:\> cd app\12.1.0\grid\oui\bin
    C:\..\bin> setup.exe -silent -detachHome ORACLE_HOME=
    'C:\app\12.1.0\grid' -local
    
  4. Move the installed files for Oracle Grid Infrastructure from the old Grid home to the new Grid home.
    For example, if the old Grid home is C:\app\12.1.0\grid and the new Grid home is D:\app\12c\grid, use the following command:
    C:\> xcopy C:\app\12.1.0\grid D:\app\12c\grid /E /I /H /K
    
  5. Clone the Oracle Grid Infrastructure installation, using the instructions provided in "Creating a Cluster by Cloning Oracle Clusterware Step 3: Run the clone.pl Script on Each Destination Node," in Oracle Clusterware Administration and Deployment Guide.
    When you navigate to the Grid_home\clone\bin directory and run the clone.pl script, provide values for the input parameters that provide the path information for the new Grid home.

    Note:

    You cannot specify a different Oracle Home user when changing the Oracle Grid Infrastructure home path.
  6. Start Oracle Clusterware in the new home location.
    D:\> cd app\12c\grid\crs\install
    D:\..install\> rootcrs.bat -patch -dstcrshome D:\app\12c\grid
    
  7. Repeat steps 1 through 4 and step 6 on each cluster member node.

9.4 Unconfiguring Oracle Clusterware Without Removing the Software

By running rootcrs.bat -deconfig -force on nodes where you encounter an installation error, you can unconfigure Oracle Clusterware on those nodes, correct the cause of the error, and then run rootcrs.bat again to reconfigure Oracle Clusterware.

Running the rootcrs.bat command with the options -deconfig -force enables you to unconfigure Oracle Clusterware on one or more nodes without removing the installed software. This feature is useful if you encounter an error on one or more cluster nodes during installation, such as incorrectly configured shared storage.

Before unconfiguring Oracle Clusterware you must:

  • Stop any databases, services, and listeners that may be installed and running

  • Dismount ACFS file systems

  • Disable ADVM volumes

Caution:

Commands used in this section remove the Oracle Grid infrastructure installation for the entire cluster. To remove the installation from an individual node, refer to Oracle Clusterware Administration and Deployment Guide.
  1. Log in using a member of the Administrators group on a node where you encountered an error during installation.
  2. Stop any databases, services, and listeners currently running from the Grid home.
  3. If present, unmount all Oracle Automatic Storage Management Cluster File System (Oracle ACFS) file systems.
  4. Change directory to Grid_home\crs\install.
    For example:
    C:\> cd C:\app\12.1.0\grid\crs\install
    
  5. Run rootcrs.bat with the -deconfig -force options.
    For example:
    C:\..\install> rootcrs.bat -deconfig -force
    

    Note:

    The -force option must be specified when running the rootcrs.bat script if there exist running resources that depend on the resources started from the Oracle Clusterware home you are deleting, such as databases, services, or listeners. You must also use the -force option if you are removing a partial, or failed installation.
  6. Repeat Step 1 through Step 5 on other nodes as required.
  7. If you are unconfiguring Oracle Clusterware on all nodes in the cluster, then on the last node, enter the following command:
    C:\..\install> rootcrs.bat -deconfig -force -lastnode
    
    The -lastnode option completes the unconfiguring of the cluster, including the Oracle Cluster Registry (OCR) and voting files.

    Caution:

    Run the rootcrs.bat -deconfig -force -lastnode command on a Hub Node. Deconfigure all Leaf Nodes before you run the command with the -lastnode flag.

9.5 Removing Oracle Clusterware and Oracle ASM Software

The deinstall command removes Oracle Clusterware and Oracle ASM from your server.

Caution:

You must use the deinstallation tool from the same release to remove Oracle software. Do not run the deinstallation tool from a later release to remove Oracle software from an earlier release. For example, do not run the deinstallation tool from the 12.1.0.1 installation media to remove Oracle software from an existing 11.2.0.4 Oracle home.

9.5.1 About the Deinstallation Tool

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

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 Oracle Database or Oracle Database Client 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 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 for Windows installation, then the deinstaller automatically runs the appropriate scripts to deconfigure Oracle Grid Infrastructure or Oracle Grid Infrastructure for standalone server.

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.bat command using the -checkonly option and -o option. You can also edit a response file template to create a response file.

Note:

You must run the deinstallation tool from the same release to remove Oracle software. Do not run the deinstallation tool from a later release to remove Oracle software from an earlier release. For example, do not run the deinstallation tool from the Oracle Database 12.1 installation media to remove Oracle software from an existing 11.2.0.4 Oracle 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.

9.5.2 Deinstallation Tool Command Reference

You can use the deinstallation tool to remove Oracle software. You can run this command in standalone mode, from an Oracle home directory, or through the installer.

Purpose

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

File Path

%ORACLE_HOME%\deinstall\deinstall

Prerequisites

Before you run the deinstallation tool for Oracle Grid Infrastructure installations:

  • Dismount Oracle Automatic Storage Management Cluster File System (Oracle ACFS) and disable Oracle Automatic Storage Management Dynamic Volume Manager (Oracle ADVM).

  • If Grid Naming Service (GNS) is in use, then notify your DNS administrator to delete the subdomain entry from the DNS.

Syntax When Using the deinstall.bat Program

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]

Syntax When Using the setup.exe Program

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]

Options

Table 9-1 Options for the Deinstallation Tool

Command Option Description
home complete path of Oracle home

Specify this option 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 option.

If you run deinstall.bat from the %ORACLE_HOME%\deinstall path, then the -home option 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 option is mandatory.

silent Specify this option 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 option does not work with failed installations.

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

checkonly

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

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

local

Specify this option on a multinode environment to deconfigure Oracle software in a cluster.

When you run deinstall.bat with this option, it deconfigures and deinstalls the Oracle software only on the local node (the node on which you run deinstall.bat) for non-shared Oracle home directories. The deinstallation tool does not deinstall or deconfigure Oracle software on remote nodes.

paramfile complete path of input response file

(Optional) You can specify this option to run deinstall.bat with a response file in a location other than the default. When you use this option, 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 specify the -paramfile option.

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

  • From the installation media or stage location: X:\staging_location\deinstall\response

  • After installation, from the installed Oracle home: %ORACLE_HOME%\deinstall\response.

params name1=value[ name2=value name3=value...] Use this option 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 option 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 invocation method of the deinstallation tool:

  • From the installation media or stage location: stagelocation\response

  • After installation, from the installed Oracle home: %ORACLE_HOME%\deinstall\response.

tmpdir complete path of temporary directory to use Specifies a non-default location where the deinstallation tool writes the temporary files for the deinstallation.
logdir complete path of log directory to use Specifies a non-default location where the deinstallation tool writes the log files for the deinstallation.
help Use the -help option to obtain additional information about the deinstallation tool options.

Location of Log Files for the Deinstallation Tool

If you use the deinstall.bat command located in an Oracle home, then the deinstallation tool writes log files in the C:\Program Files\Oracle\Inventory\logs directory.

If you are using the deinstall.bat command to remove the last Oracle home installed on the server, then the log files are written to %TEMP%\deinstall<timestamp>\logs.

9.5.3 Using the Deinstallation Tool to Remove Oracle Clusterware and Oracle ASM

You can run the deinstallation tool in multiple ways.

9.5.3.1 Running the Deinstallation Tool From an Oracle Home

You can run the deinstallation tool from an Oracle home or from the software installation media.

  1. The default method for running the deinstallation tool is from the deinstall directory in the Oracle home as the Oracle Installation user:
    C:\> %ORACLE_HOME%\deinstall\deinstall.bat
  2. 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.

Example 9-1 Running deinstall.bat From Within the Oracle Home

The most common method of running the deinstallation tool is to use the version installed in the Oracle home being removed. The deinstallation tool determines the software configuration for the local Oracle home, and then provides default values at each prompt. You can either accept the default value, or override it with a different value. 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. To use the deinstallation tool located in the Oracle home directory, issue the following command, where C:\app\12.1.0\grid is the location of Grid home:

Use the following command while logged in as a member of the Administrators group to remove the Oracle Grid Infrastructure installation from your cluster:

C:\> app\12.1.0\grid\deinstall\deinstall.bat

Provide additional information as prompted.

Note:

When using the deinstallation tool from a location other than within the Oracle home being removed, you must specify the -home option on the command line.

9.5.3.2 Running the Deinstallation Tool Interactively From the Installer

You can run the deinstallation tool from an Oracle home or from the software installation media.

  1. 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
  2. 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.

Example 9-2 Running the Deinstallation Tool from the Software Installation Media

If you run the deinstallation tool from the installer in the installation media, then when the deinstall.bat command runs, it uses the information you provide to determine the system configuration and then provides default values at each prompt. You can either accept the default value, or override it with a different value. If the software in the specified Oracle home is not running (for example, after an unsuccessful install attempt), then the deinstallation tool cannot determine the configuration, and you must provide all the configuration details either interactively or in a response file.

In this example, the setup.exe command is in the path /directory_path, where directory_path is the path to the database directory on the installation media, and C:\app\12.1.0\grid is the path to the Grid home that you want to remove.

Use the following command while logged in as a member of the Administrators group to remove the Oracle Grid Infrastructure installation from your cluster:

C:\> cd directory_path 
C:\..database> setup.exe -deinstall -home C:\app\12.1.0\grid

Provide additional information as prompted.

Note:

When using the deinstallation tool from a location other than within the Oracle home being removed, you must specify the -home option on the command line.

9.5.3.3 Running the Deinstallation Tool with a Response File

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.bat command using the –checkonly option and -o option. You can also edit a response file template to create a response file.

  • To run the deinstall.bat command located in an Oracle Grid Infrastructure home and use a response file located at D:\Users\oracle\paramfile4.tmpl, enter the following commands while logged in as a member of the Administrators group:
    C:\> cd %ORACLE_HOME% C:\..grid> deinstall\deinstall.bat -paramfile D:\Users\oracle\paramfile4.tmpl
    

9.5.3.4 Generating a Response File For Use With the Deinstallation Tool

You can generate the a response file by running the deinstall.bat command with the -checkonly and -o options before you run the command to deinstall the Oracle home, or you can use the response file template and manually edit it to create the response file.

Alternatively, you can use the response file template located at %ORACLE_HOME%\deinstall\response\deinstall.rsp.tmpl.
  • To generate the response file deinstall_OraCrs11g_home1.rsp using the deinstall.bat command located in the Oracle home and the -checkonly option, enter a command similar to the following, where C:\app\12.1.0\grid is the location of the Grid home and C:\Users\oracle is the directory in which the generated response file is created:
    C:\> app\12.1.0\grid\deinstall\deinstall.bat -checkonly -o C:\Users\oracle\
    

9.6 Example Response File for Deinstall of Oracle Grid Infrastructure

When you run the deinstall command with the -paramfile option, the deinstallation tool uses the values specified in the response file and, if needed, prompts you to supply any missing information.

Example 9-3 Example of a Response File for the Deinstallation Tool on a Cluster

The following is an example of a response file for a cluster on nodes node1 and node2, in which the Oracle Grid Infrastructure for a cluster is installed by the user grid, the Grid home is C:\app\12.1.0\grid, the Oracle base (the Oracle base for Oracle Grid Infrastructure, containing Oracle ASM log files, Oracle Clusterware logs, and other administrative files) is C:\app\grid\, the central Oracle Inventory home is C:\Program Files\Oracle\Inventory, the virtual IP addresses (VIP) are 192.0.2.2 and 192.0.2.4, and the local node (the node on which you run the deinstall.bat command) is node1:
#Copyright (c) 2005, 2009 Oracle Corporation.  All rights reserved.
VIP1_IP=192.0.2.2
LOCAL_NODE=node1
ORA_VD_DISKGROUPS=+DATA
VIP1_IF=PublicNIC
OCRID=
ObaseCleanupPtrLoc=C:\Temp\OraDeinstall112010-02-11_10-14-30AM\utl\...
HELPJAR_NAME=help4.jar
local=false
ORACLE_HOME=C:\app\12.1.0\grid
ASM_HOME=C:\app\12.1.0\grid
ASM_DISK_GROUPS=
ASM_DISK_GROUP=DATA
ORA_DBA_GROUP=
ASM_DISCOVERY_STRING=
NEW_HOST_NAME_LIST=
PRIVATE_NAME_LIST=
ASM_DISKS=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1,\\.\ORCLDISKDATA2
ASM_DISKSTRING=
CRS_HOME=true
JLIBDIR=C:\app\12.1.0\grid\jlib
OCRLOC=
JEWTJAR_NAME=jewt4.jar
EMBASEJAR_NAME=oemlt.jar
CRS_STORAGE_OPTION=1
ASM_REDUNDANCY=EXTERNAL
GPNPGCONFIGDIR=$ORACLE_HOME
LANGUAGE_ID='AMERICAN_AMERICA.WE8MSWIN1252'
CRS_NODEVIPS='node1-vip/255.255.252.0/PublicNIC,node2-vip/255.255.252.0/PublicNIC'
ORACLE_OWNER=Administrator
OLD_ACTIVE_ORACLE_HOME=
GNS_ALLOW_NET_LIST=
silent=false
LOGDIR=C:\Temp\OraDeinstall112010-02-11_10-14-30AM\logs\
OCFS_CONFIG=
NODE_NAME_LIST=node1,node2
GNS_DENY_ITF_LIST=
ORA_CRS_HOME=C:\app\12.1.0\grid
JREDIR=C:\app\12.1.0\grid\jdk\jre
ASM_LOCAL_SID=+asm1
ORACLE_BASE=C:\app\oracle\
GNS_CONF=false
NETCFGJAR_NAME=netcfg.jar
ORACLE_BINARY_OK=true
OCR_LOCATIONS=NO_VAL
ASM_ORACLE_BASE=C:\app\oracle
OLRLOC=
GPNPCONFIGDIR=$ORACLE_HOME
ORA_ASM_GROUP=
GNS_DENY_NET_LIST=
OLD_CRS_HOME=
EWTJAR_NAME=ewt3.jar
NEW_NODE_NAME_LIST=
GNS_DOMAIN_LIST=
ASM_UPGRADE=false
NETCA_LISTENERS_REGISTERED_WITH_CRS=LISTENER
CLUSTER_NODES=node1,node2
CLUSTER_GUID=
NEW_PRIVATE_NAME_LIST=
ASM_DIAGNOSTIC_DEST=C:\APP\ORACLE
CLSCFG_MISSCOUNT=
SCAN_PORT=1521
ASM_DROP_DISKGROUPS=true
NETWORKS="PublicNIC"/192.0.2.1:public,"PrivateNIC"/10.0.0.1:cluster_interconnect
OCR_VOTINGDISK_IN_ASM=true
NODELIST=node1,node2
ASM_IN_HOME=true
HOME_TYPE=CRS
GNS_ADDR_LIST=
CLUSTER_NAME=myrac-cluster
SHAREJAR_NAME=share.jar
VOTING_DISKS=NO_VAL
SILENT=false
VNDR_CLUSTER=false
GPNP_PA=
CSS_LEASEDURATION=400
REMOTE_NODES=node2
ASM_SPFILE=
HOST_NAME_LIST=node1,node2
SCAN_NAME=myrac-scan
VIP1_MASK=255.255.252.0
INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory

Note:

Do not use quotation marks around any of the values in this file, except in the following cases:
  • Around addresses for the CRS_NODEVIPS parameter:

    CRS_NODEVIPS='node1-vip/255.255.252.0/PublicNIC,node2-vip/..'
    
  • Around interface names for the NETWORKS parameters:

    NETWORKS="PublicNIC"/192.0.2.1:public,"PrivateNIC"/10.0.0.1  :cluster_interconnect