I have an Oracle Restart virtual machine that has both Oracle grid Infrastructure 12cR2 (12.2) and Oracle Database 12c R2 (12.2) + one CDB database called “orcl”.
I need to fully remove all oracle components from this machine.
About the Deinstallation Tool
Starting with Oracle Database 12c, the deinstallation tool is integrated with the database installation media. You can run the deinstallation tool using the runInstaller
command with the -deinstall
and -home
options from the base directory of the Oracle Database, Oracle Database Client or Oracle Grid Infrastructure installation media.
The deinstallation tool is also available as a separate command (deinstall
) in Oracle home directories after installation. It is located in the $ORACLE_HOME/deinstall
directory.
The deinstallation tool uses the information you provide, plus information gathered from the software home to create a response file. You can alternatively supply a response file generated previously by the deinstall
command using the –checkonly
option, or by editing the response file template.
The deinstallation tool stops Oracle software, and removes Oracle software and configuration files on the operating system for a specific Oracle home. If you run the deinstallation tool to remove an Oracle Grid Infrastructure installation, then the deinstaller prompts you to run the roothas.sh
script, as the root
user, to deconfigure Oracle Restart.
You can run the deinstallation tool in interactive mode or in silent mode. Also, you can run it with “-checkonly” option to generate a response file to be used in the “silent” mode.
Environment:



De-Install Oracle Database 12.2 Software:
I will initially run the deinstallation toll with the “-checkonly” option to generate the response file:
Login as oracle user ,and set the database environment.


Now, I’ll run the tool again with the generated response file:
./deinstall -paramfile /tmp/deinstall2019-12-11_11-53-09AM/response/deinstall_OraDB12Home1.rsp
$ ./deinstall -paramfile /tmp/deinstall2019-12-11_11-53-09AM/response/deinstall_OraDB12Home1.rsp
Checking for required files and bootstrapping …
Please wait …
Using properties file /tmp/deinstall2019-12-11_11-53-09AM/response/deinstall_OraDB12Home1.rsp
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/12.2.0.1/db_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: /u01/app/oraInventory/logs/netdc_check2019-12-11_12-04-16-PM.log
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2019-12-11_12-04-17-PM.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 [orcl]:
For Database ‘orcl’
Oracle Restart Enabled Database
The diagnostic destination location of the database: /u01/app/oracle/diag/rdbms/orcl
Storage type used by the Database: FS
Database file location: /u01/app/oracle/oradata/ORCL,/u01/app/oracle/fast_recovery_area/orcl/ORCL/controlfile
Fast recovery area location: /u01/app/oracle/fast_recovery_area/orcl/ORCL
database spfile location: /u01/app/oracle/product/12.2.0.1/db_1/dbs/spfileorcl.ora
The details of database(s) orcl have been discovered automatically. Do you still want to modify the details of orcl database(s)? [n]:
Database Check Configuration END
Oracle Configuration Manager check START
OCM check log file location : /u01/app/oraInventory/logs//ocm_check7018.log
Oracle Configuration Manager check END
################### DECONFIG CHECK OPERATION END
################# DECONFIG CHECK OPERATION SUMMARY
Oracle Home selected for deinstall is: /u01/app/oracle/product/12.2.0.1/db_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
The following databases were selected for de-configuration : orcl
Database unique name : orcl
Storage used : FS
Checking the config status for CCR
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
A log of this session will be written to: ‘/u01/app/oraInventory/logs/deinstall_deconfig2019-12-11_12-04-14-PM.out’
Any error messages from this session will be written to: ‘/u01/app/oraInventory/logs/deinstall_deconfig2019-12-11_12-04-14-PM.err’
################## DECONFIG CLEAN OPERATION START
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2019-12-11_12-04-52-PM.log
Database Clean Configuration START orcl
This operation may take few minutes.
Database Clean Configuration END orcl
Network Configuration clean config START
Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2019-12-11_12-06-12-PM.log
De-configuring Local Net Service Names configuration file…
Local Net Service Names 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
Oracle Configuration Manager clean START
OCM clean log file location : /u01/app/oraInventory/logs//ocm_clean7018.log
Oracle Configuration Manager clean END
################### DECONFIG CLEAN OPERATION END
################# DECONFIG CLEAN OPERATION SUMMARY
Successfully de-configured the following database instances : orcl
Cleaning the config for CCR
As CCR is not configured, so skipping the cleaning of CCR configuration
CCR clean is finished
#
####### ORACLE DECONFIG TOOL END
Using properties file /tmp/deinstall2019-12-11_11-53-09AM/response/deinstall_OraDB12Home1.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_deconfig2019-12-11_12-04-14-PM.out’
Any error messages from this session will be written to: ‘/u01/app/oraInventory/logs/deinstall_deconfig2019-12-11_12-04-14-PM.err’
################## DEINSTALL CLEAN OPERATION START
[START] Preparing for Deinstall
Setting LOCAL_NODE to db01
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2019-12-11_12-04-05PM/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/12.2.0.1/db_1’ from the central inventory on the local node : Done
Delete directory ‘/u01/app/oracle/product/12.2.0.1/db_1’ 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/12.2.0.1/db_1’ from the central inventory on the local node.
Successfully deleted directory ‘/u01/app/oracle/product/12.2.0.1/db_1’ on the local node.
Successfully deleted directory ‘/u01/app/oracle’ on the local node.
Oracle Universal Installer cleanup was successful.
Run ‘rm -r /opt/ORCLfmap’ as root on node(s) ‘db01’ at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#
####### ORACLE DEINSTALL TOOL END
As root user, run the following command:
# rm -rf /opt/ORCLfmap
Status from the grid side after removing the database software:

De-Install Oracle Database 12.2 Software:
Again. I’ll run the deinstall utility with the “-checkonly” option to generate the response file.
Login as grid user
set the grid environment


Now run the actual deinstall command in silent mode:





Press “Enter” in the original screen. If you keep getting the following message:
—————————————->
Press Enter after you finish running the above commands
<—————————————-
Just cancel, and review your network settings. Ensure that you can ping the server name. After that , run the deintall again and it will proceed successfully:



Donate to support our blogging work
$1.00
Thanks.
Ahmed