Today we will cover how to deinstall oracle 19c grid infrastructure. Deinstallation of Grid Infrastructure is one of the most rarest request you will come across as Oracle DBA.
When Deinstallation of Oracle 19c Grid Infrastructure will come ?
- When requestor want to de-induct the server and they want all services to be deleted from the server.
- When installation didn’t got through as planned and hence we need to clean up.
Table of Contents
Prerequisite
- Remove database registered on the database and deinstall Rdbms binaries.
- You will require root access to de-install Grid Infrastructure.
Step by Step De-installation of Oracle 19c Grid Infrastructure
Take first node in your setup with grid infrastructure owner.
In our case , grid user is the owner and we are de-installing grid infrastructure from 4 node rac whose root.sh failed for us on node 2 and node 3. Please note in my case I don’t want to retain anything.
Go to cd $ORACLE_HOME/deinstall and execute ./deinstall
$ pwd /GRIDHOME/oracle/app/product/grid/19.3.0/deinstall $ ./deinstall Checking for required files and bootstrapping ... Please wait ... Location of logs /tmp/deinstall2022-06-21_01-08-46PM/logs/ ############ ORACLE DECONFIG TOOL START ############ ######################### DECONFIG CHECK OPERATION START ######################### ## [START] Install check configuration ## Checking for existence of the Oracle home location /GRIDHOME/oracle/app/product/grid/19.3.0 Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Cluster Oracle Base selected for deinstall is: /GRIDHOME/oracle/orabase Checking for existence of central inventory location /GRIDHOME/oracle/oraInventory Checking for existence of the Oracle Grid Infrastructure home /GRIDHOME/oracle/app/product/grid/19.3.0 The following nodes are part of this cluster: oracle-01-dbworldN1,oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4 Active Remote Nodes are oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4 Checking for sufficient temp space availability on node(s) : 'oracle-01-dbworldN1,oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4' ## [END] Install check configuration ## Traces log file: /tmp/deinstall2022-06-21_01-08-46PM/logs//crsdc_2022-06-21_01-09-34-PM.log Network Configuration check config START Network de-configuration trace file location: /tmp/deinstall2022-06-21_01-08-46PM/logs/netdc_check2022-06-21_01-09-36PM.log Specify all RAC listeners (do not include SCAN listener) that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]: #-------> Pressed Enter here Network Configuration check config END Asm Check Configuration START ASM de-configuration trace file location: /tmp/deinstall2022-06-21_01-08-46PM/logs/asmcadc_check2022-06-21_01-09-36PM.log Automatic Storage Management (ASM) instance is detected in this Oracle home /GRIDHOME/oracle/app/product/grid/19.3.0. ASM Diagnostic Destination : /GRIDHOME/oracle/orabase ASM Diskgroups : +OCR_VOTE ASM diskstring : /dev/ASM/* 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 #-------> Entered 'n' and Pressed Enter here Database Check Configuration START Database de-configuration trace file location: /tmp/deinstall2022-06-21_01-08-46PM/logs/databasedc_check2022-06-21_01-09-36PM.log Oracle Grid Management database was not found in this Grid Infrastructure home Database Check Configuration END ######################### DECONFIG CHECK OPERATION END ######################### ####################### DECONFIG CHECK OPERATION SUMMARY ####################### Oracle Grid Infrastructure Home is: /GRIDHOME/oracle/app/product/grid/19.3.0 The following nodes are part of this cluster: oracle-01-dbworldN1,oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4 Active Remote Nodes are oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4 The cluster node(s) on which the Oracle home deinstallation will be performed are:oracle-01-dbworldN1,oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4 Oracle Home selected for deinstall is: /GRIDHOME/oracle/app/product/grid/19.3.0 Inventory Location where the Oracle home registered is: /GRIDHOME/oracle/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 not found in this Grid Infrastructure home Do you want to continue (y - yes, n - no)? [n]: y #------------------------> Entered 'y' and Pressed Enter here A log of this session will be written to: '/tmp/deinstall2022-06-21_01-08-46PM/logs/deinstall_deconfig2022-06-21_01-09-11-PM.out' Any error messages from this session will be written to: '/tmp/deinstall2022-06-21_01-08-46PM/logs/deinstall_deconfig2022-06-21_01-09-11-PM.err' ######################## DECONFIG CLEAN OPERATION START ######################## Database de-configuration trace file location: /tmp/deinstall2022-06-21_01-08-46PM/logs/databasedc_clean2022-06-21_01-09-36PM.log ASM de-configuration trace file location: /tmp/deinstall2022-06-21_01-08-46PM/logs/asmcadc_clean2022-06-21_01-09-36PM.log ASM Clean Configuration START ASM Clean Configuration END Network Configuration clean config START Network de-configuration trace file location: /tmp/deinstall2022-06-21_01-08-46PM/logs/netdc_clean2022-06-21_01-09-36PM.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 "oracle-03-dbworldn3". /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" Run the following command as the root user or the administrator on node "oracle-02-dbworldn2". /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" Run the following command as the root user or the administrator on node "oracle-01-dbworldn1". /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" -lastnode Press Enter after you finish running the above commands <----------------------------------------
Now it will ask us to execute deconfig commands on all remote servers.
In our case I never executed root.sh during installation on node 4 hence system asked us to fire deconfig only on node 1 node 2 and node 3
Take new session of Node 3 – with root access and then execute following command –
Node 3 # /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" Using configuration parameter file: /tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp The log of current session can be found at: /tmp/deinstall2022-06-21_01-08-46PM/logs/crsdeconfig_oracle-03-dbworldn3_2022-06-21_01-27-33PM.log PRCR-1070 : Failed to check if resource ora.net1.network is registered CRS-0184 : Cannot communicate with the CRS daemon. PRCR-1070 : Failed to check if resource ora.helper is registered CRS-0184 : Cannot communicate with the CRS daemon. PRCR-1070 : Failed to check if resource ora.ons is registered CRS-0184 : Cannot communicate with the CRS daemon. 2022/06/21 13:27:57 CLSRSC-180: An error occurred while executing the command '/GRIDHOME/oracle/app/product/grid/19.3.0/bin/srvctl config nodeapps' 2022/06/21 13:28:26 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector. 2022/06/21 13:29:36 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector. 2022/06/21 13:30:05 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node #
Now Take new session of Node 2 – with root access and then execute following command –
Node 2 # /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" Using configuration parameter file: /tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp The log of current session can be found at: /tmp/deinstall2022-06-21_01-08-46PM/logs/crsdeconfig_oracle-02-dbworldn2_2022-06-21_01-30-19PM.log PRCR-1070 : Failed to check if resource ora.net1.network is registered CRS-0184 : Cannot communicate with the CRS daemon. PRCR-1070 : Failed to check if resource ora.helper is registered CRS-0184 : Cannot communicate with the CRS daemon. PRCR-1070 : Failed to check if resource ora.ons is registered CRS-0184 : Cannot communicate with the CRS daemon. 2022/06/21 13:30:52 CLSRSC-180: An error occurred while executing the command '/GRIDHOME/oracle/app/product/grid/19.3.0/bin/srvctl config nodeapps' 2022/06/21 13:31:25 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector. 2022/06/21 13:32:35 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector. 2022/06/21 13:33:06 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node #
This will be the last node, Node 1 – with root access and then execute following command –
Node 1 - # /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" -lastnode Using configuration parameter file: /tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp The log of current session can be found at: /tmp/deinstall2022-06-21_01-08-46PM/logs/crsdeconfig_oracle-01-dbworldn1_2022-06-21_01-34-16PM.log CRS-2673: Attempting to stop 'ora.crsd' on 'oracle-01-dbworldn1' CRS-2677: Stop of 'ora.crsd' on 'oracle-01-dbworldn1' succeeded ASM de-configuration trace file location: /tmp/deinstall2022-06-21_01-08-46PM/logs/asmcadc_clean2022-06-21_01-38-20PM.log ASM Clean Configuration START ASM Clean Configuration END ASM instance deleted successfully. Check /tmp/deinstall2022-06-21_01-08-46PM/logs/asmcadc_clean2022-06-21_01-38-20PM.log for details. 2022/06/21 13:40:14 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector. 2022/06/21 13:41:25 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector. 2022/06/21 13:41:57 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node 2022/06/21 13:41:58 CLSRSC-559: Ensure that the GPnP profile data under the 'gpnp' directory in /GRIDHOME/oracle/app/product/grid/19.3.0 is deleted on each node before using the software in the current Grid Infrastructure home for reconfiguration. #
Once all commands are executed and completed. Move back to first session where you have executed ./deinstall And press Enter.
----------------------------------------> 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 "oracle-03-dbworldn3". /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" Run the following command as the root user or the administrator on node "oracle-02-dbworldn2". /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" Run the following command as the root user or the administrator on node "oracle-01-dbworldn1". /GRIDHOME/oracle/app/product/grid/19.3.0/crs/install/rootcrs.sh -force -deconfig -paramfile "/tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_OraGI19Home1.rsp" -lastnode Press Enter after you finish running the above commands <---------------------------------------- # -----> Once Execution is completed on all nodes, Pressed enter on this screen. ######################### DECONFIG CLEAN OPERATION END ######################### ####################### DECONFIG CLEAN OPERATION SUMMARY ####################### There is no Oracle Grid Management database to de-configure in this Grid Infrastructure home 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 "oracle-01-dbworldn1" Oracle Clusterware is stopped and successfully de-configured on node "oracle-03-dbworldn3" Oracle Clusterware is stopped and successfully de-configured on node "oracle-02-dbworldn2" Oracle Clusterware is stopped and de-configured successfully. ####################################################################### ############# ORACLE DECONFIG TOOL END ############# Using properties file /tmp/deinstall2022-06-21_01-08-46PM/response/deinstall_2022-06-21_01-09-11-PM.rsp Location of logs /tmp/deinstall2022-06-21_01-08-46PM/logs/ ############ ORACLE DEINSTALL TOOL START ############ ####################### DEINSTALL CHECK OPERATION SUMMARY ####################### A log of this session will be written to: '/tmp/deinstall2022-06-21_01-08-46PM/logs/deinstall_deconfig2022-06-21_01-09-11-PM.out' Any error messages from this session will be written to: '/tmp/deinstall2022-06-21_01-08-46PM/logs/deinstall_deconfig2022-06-21_01-09-11-PM.err' ######################## DEINSTALL CLEAN OPERATION START ######################## ## [START] Preparing for Deinstall ## Setting LOCAL_NODE to oracle-01-dbworldN1 Setting REMOTE_NODES to oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4 Setting CLUSTER_NODES to oracle-01-dbworldN1,oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4 Setting CRS_HOME to true Setting oracle.installer.invPtrLoc to /tmp/deinstall2022-06-21_01-08-46PM/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 '/GRIDHOME/oracle/app/product/grid/19.3.0' from the central inventory on the local node : Done Delete directory '/GRIDHOME/oracle/app/product/grid/19.3.0' on the local node : Done Delete directory '/GRIDHOME/oracle/oraInventory' on the local node : Done Delete directory '/GRIDHOME/oracle/orabase' on the local node : Done Detach Oracle home '/GRIDHOME/oracle/app/product/grid/19.3.0' from the central inventory on the remote nodes 'oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4' : Done Delete directory '/GRIDHOME/oracle/app/product/grid/19.3.0' on the remote nodes 'oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4' : Done Delete directory '/GRIDHOME/oracle/oraInventory' on the remote nodes 'oracle-02-dbworldn2' : Done Delete directory '/GRIDHOME/oracle/oraInventory' on the remote nodes 'oracle-03-dbworldn3' : Done Delete directory '/GRIDHOME/oracle/oraInventory' on the remote nodes 'oracle-04-dbworldn4' : Done Delete directory '/GRIDHOME/oracle/orabase' on the remote nodes 'oracle-02-dbworldn2' : Done Delete directory '/GRIDHOME/oracle/orabase' on the remote nodes 'oracle-03-dbworldn3' : Done The Oracle Base directory '/GRIDHOME/oracle/orabase' will not be removed on node 'oracle-04-dbworldn4'. The directory is not empty. Oracle Universal Installer cleanup was successful. Oracle Universal Installer clean END ## [START] Oracle install clean ## Clean install operation removing temporary directory '/tmp/deinstall2022-06-21_01-08-46PM' on node 'oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4' ## [END] Oracle install clean ## ######################### DEINSTALL CLEAN OPERATION END ######################### ####################### DEINSTALL CLEAN OPERATION SUMMARY ####################### Successfully detached Oracle home '/GRIDHOME/oracle/app/product/grid/19.3.0' from the central inventory on the local node. Successfully deleted directory '/GRIDHOME/oracle/app/product/grid/19.3.0' on the local node. Successfully deleted directory '/GRIDHOME/oracle/oraInventory' on the local node. Successfully deleted directory '/GRIDHOME/oracle/orabase' on the local node. Successfully detached Oracle home '/GRIDHOME/oracle/app/product/grid/19.3.0' from the central inventory on the remote nodes 'oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4'. Successfully deleted directory '/GRIDHOME/oracle/app/product/grid/19.3.0' on the remote nodes 'oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4'. Successfully deleted directory '/GRIDHOME/oracle/oraInventory' on the remote nodes 'oracle-02-dbworldn2'. Successfully deleted directory '/GRIDHOME/oracle/oraInventory' on the remote nodes 'oracle-03-dbworldn3'. Successfully deleted directory '/GRIDHOME/oracle/oraInventory' on the remote nodes 'oracle-04-dbworldn4'. Successfully deleted directory '/GRIDHOME/oracle/orabase' on the remote nodes 'oracle-02-dbworldn2'. Successfully deleted directory '/GRIDHOME/oracle/orabase' on the remote nodes 'oracle-03-dbworldn3'. Oracle Universal Installer cleanup was successful. Run 'rm -r /etc/oraInst.loc' as root on node(s) 'oracle-01-dbworldN1,oracle-02-dbworldn2,oracle-03-dbworldn3,oracle-04-dbworldn4' at the end of the session. Run 'rm -r /opt/ORCLfmap' as root on node(s) 'oracle-01-dbworldN1,oracle-02-dbworldn2,oracle-03-dbworldn3' at the end of the session. Review the permissions and contents of '/GRIDHOME/oracle/orabase' on nodes(s) 'oracle-01-dbworldN1,oracle-04-dbworldn4'. If there are no Oracle home(s) associated with '/GRIDHOME/oracle/orabase', manually delete '/GRIDHOME/oracle/orabase' and its contents. Oracle deinstall tool successfully cleaned up temporary directories. ####################################################################### ############# ORACLE DEINSTALL TOOL END ############# $
Now we have cleared few folders and files
rm -r /etc/oraInst.loc rm -rf /GRIDHOME/oracle/oraInventory rm -rf /GRIDHOME/oracle/orabase rm -rf /GRIDHOME/oracle/app/product/grid/19.3.0