In this post, we will see how to de-install Oracle Grid and Database Binaries in 19c Environment

Let us first proceed with deinstalling the Database binaries before proceeding with Grid

Please click on the INDEX and browse for more interesting posts.

 

Drop the DB Binaries

Go to $ORACLE_HOME/deinstall

 [oracle@jack deinstall]$ pwd
/u01/app/oracle/product/19c/db_1/deinstall

Run the deinstaller

[oracle@jack deinstall]$ ./deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /u01/app/oraInventory/logs/
############ ORACLE DECONFIG TOOL START ############
######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##
Checking for existence of the Oracle home location /u01/app/oracle/product/19c/db_1
Oracle Home type selected for deinstall is: Oracle Real Application Cluster Database
Oracle Base selected for deinstall is: /u01/app/orabase
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/19c/grid
The following nodes are part of this cluster: jack,jill
Active Remote Nodes are jill
Checking for sufficient temp space availability on node(s) : 'jack,jill'
## [END] Install check configuration ##
Network Configuration check config START
Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2021-04-17_04-41-29PM.log
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2021-04-17_04-41-29PM.log
Use comma as separator when specifying list of values as input
Specify the list of database names that are configured in this Oracle home [infra]: infra
###### For Database 'infra' ######
RAC Database
The nodes on which this database has instances: [jack, jill]
The instance names: [infra1, infra2]
The local instance name on node: infra1 
The diagnostic destination location of the database: /u01/app/orabase/diag/rdbms/infra
Storage type used by the Database: ASM
The details of database(s) infra have been discovered automatically. Do you still want to modify the details of infra database(s)? [n]: n
Database Check Configuration END
######################### DECONFIG CHECK OPERATION END #########################
####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/19c/grid
The following nodes are part of this cluster: jack,jill
Active Remote Nodes are jill
The cluster node(s) on which the Oracle home deinstallation will be performed are:jack,jill
Oracle Home selected for deinstall is: /u01/app/oracle/product/19c/db_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
The following databases were selected for de-configuration. The databases will be deleted and will not be useful upon de-configuration : infra
Database unique name : infra
Storage used : ASM
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-04-17_04-40-51-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-04-17_04-40-51-PM.err'
######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2021-04-17_04-41-29PM.log
Database Clean Configuration START infra
This operation may take few minutes.
Database Clean Configuration END infra
Network Configuration clean config START
Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2021-04-17_04-41-29PM.log
De-configuring Listener configuration file on all nodes...
Listener configuration file de-configured successfully.
De-configuring Naming Methods configuration file on all nodes...
Naming Methods configuration file de-configured successfully.
De-configuring Local Net Service Names configuration file on all nodes...
Local Net Service Names configuration file de-configured successfully.
De-configuring Directory Usage configuration file on all nodes...
Directory Usage configuration file de-configured successfully.
De-configuring backup files on all nodes...
Backup files de-configured successfully.
The network configuration has been cleaned up successfully.
Network Configuration clean config END
######################### DECONFIG CLEAN OPERATION END #########################
####################### DECONFIG CLEAN OPERATION SUMMARY #######################
Successfully de-configured the following database instances : infra
#######################################################################
############# ORACLE DECONFIG TOOL END #############
Using properties file /tmp/deinstall2021-04-17_04-40-29PM/response/deinstall_2021-04-17_04-40-51-PM.rsp
Location of logs /u01/app/oraInventory/logs/
############ ORACLE DEINSTALL TOOL START ############
####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-04-17_04-40-51-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-04-17_04-40-51-PM.err'
######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to jack
Setting REMOTE_NODES to jill
Setting CLUSTER_NODES to jack,jill
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2021-04-17_04-40-29PM/oraInst.loc
Setting oracle.installer.local to false
## [END] Preparing for Deinstall ##
Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START
Detach Oracle home '/u01/app/oracle/product/19c/db_1' from the central inventory on the local node : Done
Delete directory '/u01/app/oracle/product/19c/db_1' on the local node : Done
Failed to delete the directory '/u01/app/orabase'. Either user has no permission to delete or it is in use.
Delete directory '/u01/app/orabase' on the local node : Failed <<<<
Detach Oracle home '/u01/app/oracle/product/19c/db_1' from the central inventory on the remote nodes 'jill' : Done
Delete directory '/u01/app/oracle/product/19c/db_1' on the remote nodes 'jill' : Done
Delete directory '/u01/app/orabase' on the remote nodes 'jill' : Failed <<<<
The directory '/u01/app/orabase' could not be deleted on the nodes 'jill'.
Oracle Universal Installer cleanup completed with errors.
Oracle Universal Installer clean END
## [START] Oracle install clean ##
Clean install operation removing temporary directory '/tmp/deinstall2021-04-17_04-40-29PM' on node 'jill'
## [END] Oracle install clean ##
######################### DEINSTALL CLEAN OPERATION END #########################
####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/oracle/product/19c/db_1' from the central inventory on the local node.
Successfully deleted directory '/u01/app/oracle/product/19c/db_1' on the local node.
Failed to delete directory '/u01/app/orabase' on the local node due to error : Either user has no permission to delete or file is in use.
Review the permissions and manually delete '/u01/app/orabase' on local node.
Successfully detached Oracle home '/u01/app/oracle/product/19c/db_1' from the central inventory on the remote nodes 'jill'.
Successfully deleted directory '/u01/app/oracle/product/19c/db_1' on the remote nodes 'jill'.
Failed to delete directory '/u01/app/orabase' on the remote nodes 'jill' due to error : Error in removing dir '/u01/app/orabase' on nodes 'jill'. [PRKC-1083 : Failed to remove listed directory in "/tmp/OraInstall2021-04-17_04-47-30PM/removeInvDir_jill_2021-04-17_04-49-02PM" to any of the given nodes "jill ". 
Error on node jill:/bin/rm: cannot remove ‘/u01/app/orabase/’: Permission denied]
Review the permissions and manually delete '/u01/app/orabase' on node(s) jill.
Oracle Universal Installer cleanup completed with errors.
Review the permissions and contents of '/u01/app/orabase' on nodes(s) 'jack,jill'.
If there are no Oracle home(s) associated with '/u01/app/orabase', manually delete '/u01/app/orabase' and its contents.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
############# ORACLE DEINSTALL TOOL END #############

 

Due to permission issue, the directory was only not deleted. This needs to be dropped by root user

[oracle@jack orabase]$ pwd
/u01/app/orabase
[oracle@jack orabase]$ ls -ltr
total 0
[oracle@jack app]$ rm -rf orabase

 

So we are done with deinstalling Database and database binaries in the RAC Environment.
Now let us proceed with deinstalling the GRID Infrastructure

 

Deinstall Grid infrastructure

Go to $GRID_HOME/deinstall

[oracle@jack deinstall]$ pwd
/u01/app/19c/grid/deinstall

Run the deinstaller

[oracle@jack deinstall]$ ./deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2021-04-17_05-00-17PM/logs/
############ ORACLE DECONFIG TOOL START ############
######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##
Checking for existence of the Oracle home location /u01/app/19c/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Cluster
Oracle Base selected for deinstall is: /u01/app/gridbase
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/19c/grid
The following nodes are part of this cluster: jack,jill
Active Remote Nodes are jill
Checking for sufficient temp space availability on node(s) : 'jack,jill'
## [END] Install check configuration ##
Traces log file: /tmp/deinstall2021-04-17_05-00-17PM/logs//crsdc_2021-04-17_05-00-58-PM.log
Network Configuration check config START
Network de-configuration trace file location: /tmp/deinstall2021-04-17_05-00-17PM/logs/netdc_check2021-04-17_05-01-00PM.log
Specify all RAC listeners (do not include SCAN listener) that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]: LISTENER
Network Configuration check config END
Asm Check Configuration START
ASM de-configuration trace file location: /tmp/deinstall2021-04-17_05-00-17PM/logs/asmcadc_check2021-04-17_05-01-00PM.log
Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/19c/grid.
ASM Diagnostic Destination : /u01/app/gridbase
ASM Diskgroups : +DATA,+FRA
ASM diskstring : /dev/oracleasm/disks*
Diskgroups will be dropped
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
Database Check Configuration START
Database de-configuration trace file location: /tmp/deinstall2021-04-17_05-00-17PM/logs/databasedc_check2021-04-17_05-01-00PM.log
Oracle Grid Management database was found in this Grid Infrastructure home
Database Check Configuration END
######################### DECONFIG CHECK OPERATION END #########################
####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/19c/grid
The following nodes are part of this cluster: jack,jill
Active Remote Nodes are jill
The cluster node(s) on which the Oracle home deinstallation will be performed are:jack,jill
Oracle Home selected for deinstall is: /u01/app/19c/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
A log of this session will be written to: '/tmp/deinstall2021-04-17_05-00-17PM/logs/deinstall_deconfig2021-04-17_05-00-41-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2021-04-17_05-00-17PM/logs/deinstall_deconfig2021-04-17_05-00-41-PM.err'
######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2021-04-17_05-00-17PM/logs/databasedc_clean2021-04-17_05-01-00PM.log
This operation may take few minutes.
ASM de-configuration trace file location: /tmp/deinstall2021-04-17_05-00-17PM/logs/asmcadc_clean2021-04-17_05-01-00PM.log
ASM Clean Configuration START
ASM Clean Configuration END
Network Configuration clean config START
Network de-configuration trace file location: /tmp/deinstall2021-04-17_05-00-17PM/logs/netdc_clean2021-04-17_05-01-00PM.log
De-configuring RAC listener(s): LISTENER
De-configuring listener: LISTENER
    Stopping listener: LISTENER
    Listener stopped successfully.
    Unregistering listener: LISTENER
    Listener unregistered successfully.
Listener de-configured successfully.
De-configuring Naming Methods configuration file on all nodes...
Naming Methods configuration file de-configured successfully.
De-configuring Local Net Service Names configuration file on all nodes...
Local Net Service Names configuration file de-configured successfully.
De-configuring Directory Usage configuration file on all nodes...
Directory Usage configuration file de-configured successfully.
De-configuring backup files on all nodes...
Backup files de-configured successfully.
The network configuration has been cleaned up successfully.
Network Configuration clean config END
---------------------------------------->

The deconfig command below can be executed in parallel on all the remote nodes. Execute the command on  the local node after the execution completes on all the remote nodes.

Run the following command as the root user or the administrator on node "jill".

/u01/app/19c/grid/crs/install/rootcrs.sh -force  -deconfig -paramfile "/tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp"

Run the following command as the root user or the administrator on node "jack".

/u01/app/19c/grid/crs/install/rootcrs.sh -force  -deconfig -paramfile "/tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp" -lastnode

Press Enter after you finish running the above commands

<----------------------------------------

 

Clean up the Grid Infrastructure

Run the following command as the root user or the administrator on node “jill”.

[root@jill ~]# /u01/app/19c/grid/crs/install/rootcrs.sh -force  -deconfig -paramfile "/tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp"
Using configuration parameter file: /tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp
The log of current session can be found at:
  /tmp/deinstall2021-04-17_05-00-17PM/logs/crsdeconfig_jill_2021-04-17_05-11-50PM.log
2021/04/17 17:16:56 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector.
2021/04/17 17:19:03 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector.
2021/04/17 17:19:07 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node

 

Run the following command as the root user or the administrator on node “jack”.

[root@jack ~]# /u01/app/19c/grid/crs/install/rootcrs.sh -force  -deconfig -paramfile "/tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp" -lastnode
Using configuration parameter file: /tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp
The log of current session can be found at:
  /tmp/deinstall2021-04-17_05-00-17PM/logs/crsdeconfig_jack_2021-04-17_05-22-46PM.log
CRS-2673: Attempting to stop 'ora.crsd' on 'jack'
CRS-2677: Stop of 'ora.crsd' on 'jack' succeeded
ASM de-configuration trace file location: /tmp/deinstall2021-04-17_05-00-17PM/logs/asmcadc_clean2021-04-17_05-30-02PM.log
ASM Clean Configuration START
ASM Clean Configuration END

ASM instance deleted successfully. Check /tmp/deinstall2021-04-17_05-00-17PM/logs/asmcadc_clean2021-04-17_05-30-02PM.log for details.

2021/04/17 17:32:04 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector.
2021/04/17 17:33:58 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector.
2021/04/17 17:34:04 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node
2021/04/17 17:34:04 CLSRSC-559: Ensure that the GPnP profile data under the 'gpnp' directory in /u01/app/19c/grid is deleted on each node before using the software in the current Grid Infrastructure home for reconfiguration.

Once you completed the running of the scripts on the nodes, enter and continue to deinstall as follows :

---------------------------------------->
The deconfig command below can be executed in parallel on all the remote nodes. Execute the command on  the local node after the execution completes on all the remote nodes.
Run the following command as the root user or the administrator on node "jill".
/u01/app/19c/grid/crs/install/rootcrs.sh -force  -deconfig -paramfile "/tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp"
Run the following command as the root user or the administrator on node "jack".
/u01/app/19c/grid/crs/install/rootcrs.sh -force  -deconfig -paramfile "/tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_OraGI19Home1.rsp" -lastnode
Press Enter after you finish running the above commands
<----------------------------------------
######################### DECONFIG CLEAN OPERATION END #########################
####################### DECONFIG CLEAN OPERATION SUMMARY #######################
Successfully de-configured Oracle Grid Management database
ASM instance was de-configured successfully from the Oracle home
Following RAC listener(s) were de-configured successfully: LISTENER
Oracle Clusterware is stopped and successfully de-configured on node "jack"
Oracle Clusterware is stopped and successfully de-configured on node "jill"
Oracle Clusterware is stopped and de-configured successfully.
#######################################################################
############# ORACLE DECONFIG TOOL END #############
Using properties file /tmp/deinstall2021-04-17_05-00-17PM/response/deinstall_2021-04-17_05-00-41-PM.rsp
Location of logs /tmp/deinstall2021-04-17_05-00-17PM/logs/
############ ORACLE DEINSTALL TOOL START ############
####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/tmp/deinstall2021-04-17_05-00-17PM/logs/deinstall_deconfig2021-04-17_05-00-41-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2021-04-17_05-00-17PM/logs/deinstall_deconfig2021-04-17_05-00-41-PM.err'
######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to jack
Setting REMOTE_NODES to jill
Setting CLUSTER_NODES to jack,jill
Setting CRS_HOME to true
Setting oracle.installer.invPtrLoc to /tmp/deinstall2021-04-17_05-00-17PM/oraInst.loc
Setting oracle.installer.local to false
## [END] Preparing for Deinstall ##
Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START
Detach Oracle home '/u01/app/19c/grid' from the central inventory on the local node : Done
Delete directory '/u01/app/19c/grid' on the local node : Done
Delete directory '/u01/app/oraInventory' on the local node : Done
Delete directory '/u01/app/gridbase' on the local node : Done
Detach Oracle home '/u01/app/19c/grid' from the central inventory on the remote nodes 'jill' : Done
Delete directory '/u01/app/19c/grid' on the remote nodes 'jill' : Done
Delete directory '/u01/app/oraInventory' on the remote nodes 'jill' : Done
Delete directory '/u01/app/gridbase' on the remote nodes 'jill' : Done
Oracle Universal Installer cleanup was successful.
Oracle Universal Installer clean END
## [START] Oracle install clean ##
Clean install operation removing temporary directory '/tmp/deinstall2021-04-17_05-00-17PM' on node 'jill'
## [END] Oracle install clean ##
######################### DEINSTALL CLEAN OPERATION END #########################
####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/19c/grid' from the central inventory on the local node.
Successfully deleted directory '/u01/app/19c/grid' on the local node.
Successfully deleted directory '/u01/app/oraInventory' on the local node.
Successfully deleted directory '/u01/app/gridbase' on the local node.
Successfully detached Oracle home '/u01/app/19c/grid' from the central inventory on the remote nodes 'jill'.
Successfully deleted directory '/u01/app/19c/grid' on the remote nodes 'jill'.
Successfully deleted directory '/u01/app/oraInventory' on the remote nodes 'jill'.
Successfully deleted directory '/u01/app/gridbase' on the remote nodes 'jill'.
Oracle Universal Installer cleanup was successful.
Run 'rm -r /etc/oraInst.loc' as root on node(s) 'jack,jill' at the end of the session.
Run 'rm -r /opt/ORCLfmap' as root on node(s) 'jack,jill' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

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

 

Delete the files as mentioned

[root@jack ~]# rm -r /etc/oraInst.loc
rm: remove regular file ‘/etc/oraInst.loc’? y
[root@jack ~]# rm -r /opt/ORCLfmap
rm: descend into directory ‘/opt/ORCLfmap’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64/bin’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/bin/fmputl’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/bin/fmputlhp’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/bin’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64/etc’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/etc/filemap.ora’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/etc’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/log’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64’? y
rm: remove directory ‘/opt/ORCLfmap’? y

 

This marks the end of deinstallation and Deconfiguration of Oracle Grid Infrastructure 19c