Uninstall Oracle 19c in Linux/OL8 and remove Oracle configuration files completely

  • Post author:
  • Post category:DBA
  • Post last modified:September 6, 2023

With some reasons, we need to remove or uninstall Oracle Database from our computer. for Oracle Database 19c, it is easy to remove Oracle software and configuration files on the operating system for a specific Oracle home using deinstall command. in this guide we describe how to remove Oracle software and configuration files for version Oracle 19c in Linux/OL8 or above.

Before Execute Command

Before Uninstall Oracle 19c software from the system, make sure the following points first

1- Backup Your Data:

Before proceeding with the uninstallation process, it’s recommended to back up your database and any other important data.

2- Shutdown database

shutdown

3- Stop Listener

lsnrctl stop

Execute Deinstall Command

the deinstall command is available in deinstall directory and can be find like below

[root@oraclelinux dbhome_1]# cd /u01/app/oracle/product/19c/dbhome_1/deinstall/

Output

[oracle@oraclelinux deinstall]$ ./deinstall
Checking for required files and bootstrapping …
Please wait …
Location of logs /tmp/deinstall2023-08-28_06-40-35PM/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/dbhome_1
Oracle Home type selected for deinstall is: Oracle Single Instance Database
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory

##[END] Install check configuration ##

Network Configuration check config START
Network de-configuration trace file location: /tmp/deinstall2023-08-28_06-40-35PM/logs/netdc_check2023-08-28_06-41-07PM.log
Specify all Single Instance listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /tmp/deinstall2023-08-28_06-40-35PM/logs/databasedc_check2023-08-28_06-41-07PM.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 []:
Database Check Configuration END
################### DECONFIG CHECK OPERATION END ######################

################# DECONFIG CHECK OPERATION SUMMARY ###################
Oracle Home selected for deinstall is: /u01/app/oracle/product/19c/dbhome_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Single Instance listener(s) will be de-configured: LISTENER
Do you want to continue (y – yes, n – no)? [n]: y
A log of this session will be written to: ‘/tmp/deinstall2023-08-28_06-40-35PM/logs/deinstall_deconfig2023-08-28_06-41-05-PM.out’
Any error messages from this session will be written to: ‘/tmp/deinstall2023-08-28_06-40-35PM/logs/deinstall_deconfig2023-08-28_06-41-05-PM.err’

################## DECONFIG CLEAN OPERATION START ################

Database de-configuration trace file location: /tmp/deinstall2023-08-28_06-40-35PM/logs/databasedc_clean2023-08-28_06-41-07PM.log
Network Configuration clean config START
Network de-configuration trace file location: /tmp/deinstall2023-08-28_06-40-35PM/logs/netdc_clean2023-08-28_06-41-07PM.log
De-configuring Single Instance listener(s): LISTENER

De-configuring listener: LISTENER
Stopping listener: LISTENER
Listener stopped successfully.
Deleting listener: LISTENER
Listener deleted successfully.
Listener de-configured successfully.

De-configuring Naming Methods configuration file…
Naming Methods configuration file de-configured successfully.

De-configuring backup files…
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 #######################
Following Single Instance listener(s) were de-configured successfully: LISTENER
#######################################################################

####### ORACLE DECONFIG TOOL END #######################
Using properties file /tmp/deinstall2023-08-28_06-40-35PM/response/deinstall_2023-08-28_06-41-05-PM.rsp
Location of logs /tmp/deinstall2023-08-28_06-40-35PM/logs/

###### ORACLE DEINSTALL TOOL START ########################

################# DEINSTALL CHECK OPERATION SUMMARY ######################
A log of this session will be written to: ‘/tmp/deinstall2023-08-28_06-40-35PM/logs/deinstall_deconfig2023-08-28_06-41-05-PM.out’
Any error messages from this session will be written to: ‘/tmp/deinstall2023-08-28_06-40-35PM/logs/deinstall_deconfig2023-08-28_06-41-05-PM.err’

################## DEINSTALL CLEAN OPERATION START ########################
##[START] Preparing for Deinstall ##
Setting LOCAL_NODE to oraclelinux
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2023-08-28_06-40-35PM/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/dbhome_1’ from the central inventory on the local node : Done
Delete directory ‘/u01/app/oracle/product/19c/dbhome_1’ on the local node : Done
Delete directory ‘/u01/app/oraInventory’ on the local node : Done
Delete directory ‘/u01/app/oracle’ on the local node : Done
Oracle Universal Installer cleanup was successful.
Oracle Universal Installer clean END

##[START] Oracle install clean ##

## [END] Oracle install clean ##

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

################# DEINSTALL CLEAN OPERATION SUMMARY ######################
Successfully detached Oracle home ‘/u01/app/oracle/product/19c/dbhome_1’ from the central inventory on the local node.
Successfully deleted directory ‘/u01/app/oracle/product/19c/dbhome_1’ on the local node.
Successfully deleted directory ‘/u01/app/oraInventory’ on the local node.
Successfully deleted directory ‘/u01/app/oracle’ on the local node.
Oracle Universal Installer cleanup was successful.

Run ‘rm -r /etc/oraInst.loc’ as root on node(s) ‘oraclelinux’ at the end of the session.
Run ‘rm -r /opt/ORCLfmap’ as root on node(s) ‘oraclelinux’ at the end of the session.
Run ‘rm -r /etc/oratab’ as root on node(s) ‘oraclelinux’ at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
##############################################################

####### ORACLE DEINSTALL TOOL END #################################
[oracle@oraclelinux deinstall]$

Execute Commands to remove configuration

Use below commands to remove configuration permanently from system.

sudo rm -rf /etc/oraInst.loc
sudo rm -rf /opt/ORCLfmap
sudo rm -rf /etc/oratab

Conclusion:

In this blog post we learnt the step-by-step process how to Uninstall Oracle 19c from Linux/OL8.

Read More

How to Resolve INS-08101 Unexpected Error on Linux/OL 8