Sometimes we need to remove or un-install Oracle Database from our computer. These topics describe how to remove Oracle software and configuration files for version Oracle 19c in Windows and Unix/Linux.
Uninstalling oracle database is little bit complex in 12c because it sets different file in different location during install. If properly those file is not deleted Oracle will not install next time. But in 19c, it is easy to remove Oracle software and configuration files on the operating system for a specific Oracle home using deinstall command.
shutdown
lsnrctl stop
The deinstall command uses the following syntax:
(./deinstall [-silent] [-checkonly] [-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] [-local] [-skipLocalHomeDeletion] [-skipRemoteHomeDeletion] [-help]
Use -silent flag to run deinstall in noninteractive mode. This option requires one of the following:
For understanding all option, https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/oracle-deinstallation-tool-deinstall.html#GUID-71E860C5-4E1E-4D2F-AFD1-141709A172C0
At now, run the deinstall command from an Oracle home directory after installation.
$ORACLE_HOME/deinstall/deinstall
….. Successfully deleted directory '/u01/app/oraInventory' on the local node. Oracle Universal Installer cleanup was successful. Run 'rm -rf /etc/oraInst.loc' as root on node(s) 'medmgmt-193' at the end of the session. Run 'rm -rf /opt/ORCLfmap' as root on node(s) 'medmgmt-193' at the end of the session. Run 'rm -rf /etc/oratab' as root on node(s) 'medmgmt-193' at the end of the session. Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'medmgmt-193'. If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents.
Sometimes ORACLE software installation gets corrupted and in such case, above deinstallation utilities will not help you to remove oracle software. Use below method to remove the oracle home using Linux commands.
According output status, execute remove command:
sudo rm -rf /etc/oraInst.loc sudo rm -rf /opt/ORCLfmap sudo rm -rf /etc/oratab
Finally Delete ORACLE_HOME
cd $ORACLE_HOME rm -Rf *
Delete ORACLE_BASE
cd $ORACLE_BASE rm -Rf *
I think, it will help you. Enjoy!