oracledba.help

Oracle Database and GI Deinstallation

<- Install

TOC

Overview

The following covers how to completely deinstall the Oracle database and GI product home directories from a system. This example shows deinstallation of 12.1.0.2 in a RAC environment. Change as required for your environment.

Example RAC Environment

Node Nameslnx01, lnx02
Database Nameoradb
Instance Namesoradb1, oradb2

Deinstall Database Home

  1. Log in as oracle user.
  2. Ensure database is shut down.
  3. cd /u01/orasw/database
  4. ./runInstaller -deinstall -home /u01/app/oracle/product/12.1.0.2/dbhome_1/
 Specify the list of database names that are configured in this 
 Oracle home [oradb]: ENTER

 The details of database(s) oradb have been discovered automatically. 
 Do you still want to modify the details of oradb database(s)? [n]: y

 Specify the type of this database 
 1.Single Instance Database 
 2.Oracle Restart Enabled Database 
 3.RAC Database
 4.RAC One Node Database [3]: 3

 Specify the list of nodes on which this database has instances [lnx01, lnx02]: ENTER
 Specify the list of instance names [oradb1, oradb2]: ENTER 
 Specify the local instance name on node lnx01  [oradb1]: ENTER
 Specify the diagnostic destination location of the database [/u01/...]: ENTER
 Specify the storage type used by the Database ASM|FS [ASM]: ENTER

 Checking the config status for CCR
 lnx01 : Oracle Home exists with CCR directory, but CCR is not configured
 lnx02 : Oracle Home exists with CCR directory, but CCR is not configured
 CCR check is finished
 Do you want to continue (y - yes, n - no)? [n]: y

 Deinstall process runs on all nodes...

This works the same for 12.2.0.1 too.

Process End Output Example

####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/oracle/product/12.1.0.2/dbhome_1' from the central
  inventory on the local node.
Successfully deleted directory '/u01/app/oracle/product/12.1.0.2/dbhome_1' on the local node.
Failed to delete directory '/u01/app/oracle' on the local node.
Successfully detached Oracle home '/u01/app/oracle/product/12.1.0.2/dbhome_1' from the central
  inventory on the remote nodes 'lnx02'.
Successfully deleted directory '/u01/app/oracle/product/12.1.0.2/dbhome_1' 
   on the remote nodes 'lnx02'.
Failed to delete directory '/u01/app/oracle' 
   on the remote nodes 'lnx02'.
Oracle Universal Installer cleanup completed with errors.

Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

############# ORACLE DEINSTALL TOOL END #############

Deinstall Grid Home

To remove the Oracle Grid Infrastructure home, use the deinstallation script in the Oracle Grid Infrastructure home.

  1. Log in as grid user.
  2. Purge all ASM groups\data if it will not be used by any instance from system.
  3. Ensure grid services are shut down.
    • 12.1:
      cd /u01/orasw/grid
      ./runInstaller -deinstall -home /u01/app/12.1.0.2/grid/
    • 12.2:
      /u01/app/12.2.0.1/grid/deinstall/deinstall
 Specify all RAC listeners (do not include SCAN listener) that are to be 
 de-configured. Enter .(dot) to deselect all. [LISTENER]: ENTER

 De-configuring ASM will drop all the diskgroups and their contents at 
 cleanup time. This will affect all of the databases and ACFS that use this 
 ASM instance(s).

 If you want to retain the existing diskgroups or if any of the information
 detected is incorrect, you can modify by entering 'y'. Do you  want to modify
 above information (y|n) [n]: n

 ####################### DECONFIG CHECK OPERATION SUMMARY #######################
 Oracle Grid Infrastructure Home is: /u01/app/12.1.0.2/grid
 The following nodes are part of this cluster: lnx01,lnx02
 Active Remote Nodes are lnx02
 The cluster node(s) on which the Oracle home deinstallation will be performed are:lnx01...
 Oracle Home selected for deinstall is: /u01/app/12.1.0.2/grid
 Inventory Location where the Oracle home registered is: /u01/app/oraInventory
 Following RAC listener(s) will be de-configured: LISTENER
 ASM instance will be de-configured from this Oracle home
 Oracle Grid Management database was found in this Grid Infrastructure home
 Oracle Grid Management database will be de-configured from this Grid Infrastructure home
 Do you want to continue (y - yes, n - no)? [n]: y

 Process runs...

root Script Prompts

You will be prompted to run scripts as root on each node.

 Run the following command as the root user or the administrator on node "lnx02".
 /tmp/deinstall2018-05-18_01-06-41PM/perl/bin/perl  
 -I/tmp/deinstall2018-05-18_01-06-41PM/perl/lib  
 -I/tmp/deinstall2018-05-18_01-06-41PM/crs/install  
 /tmp/deinstall2018-05-18_01-06-41PM/crs/install/rootcrs.pl 
 -force -deconfig -paramfile 
 " /tmp/deinstall2018-05-18_01-06-41PM/response/deinstall_OraGI12Home1.rsp"

 Run the following command as the root user or the administrator on node "lnx01".
 /tmp/deinstall2018-05-18_01-06-41PM/perl/bin/perl 
 -I/tmp/deinstall2018-05-18_01-06-41PM/perl/lib 
 -I/tmp/deinstall2018-05-18_01-06-41PM/crs/install 
 /tmp/deinstall2018-05-18_01-06-41PM/crs/install/rootcrs.pl 
 -force  -deconfig -paramfile 
 " /tmp/deinstall2018-05-18_01-06-41PM/response/deinstall_OraGI12Home1.rsp" -lastnode

 Press Enter after you finish running the above commands

Copy and Paste the scripts shown on your system. The ones shown above are an example.

When each root script has completed it should display:
CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node

Process End Output Example

######################## DEINSTALL CLEAN OPERATION END #########################

####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/...' from the central inventory on the local node.
Successfully deleted directory '/u01/app/12.1.0.2/grid' on the local node.
Successfully deleted directory '/u01/app/oraInventory' on the local node.
Successfully deleted directory '/u01/app/grid' on the local node.
Successfully detached Oracle home '/u01/...' from the central inventory ... 'lnx02'.
Successfully deleted directory '/u01/app/.../grid' on the remote nodes 'lnx02'.
Successfully deleted directory '/u01/...' on the remote nodes 'lnx02'.
Successfully deleted directory '/u01/app/grid' on the remote nodes 'lnx02'.
Oracle Universal Installer cleanup was successful.

Run 'rm -r /etc/oraInst.loc' as root on node(s) 'lnx01,lnx02' at the end of the session.

Run 'rm -r /opt/ORCLfmap' as root on node(s) 'lnx01,lnx02' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

############# ORACLE DEINSTALL TOOL END #############

Make sure to run the rm commands as indicated for:

  • rm -rf /etc/oraInst.loc
  • rm -rf /opt/ORCLfmap

If you are going to be reinstalling Oracle or GI you might also need to remove the inventory directory. Example: rm -rf /u01/app/oraInventory


Oracle Restart Example

 cd /u01/orasw/grid
 ./runInstaller -deinstall -home /u01/app/grid/product/12.1.0.2/grid