In this article, we will see how to deinstall Oracle Database 18c. There are different ways to deinstall Oracle Database, but we will see what Oracle recommends to do to deinstall Oracle Database RDBMS software. We also need to understand what is being deleted as part of deinstall process.
The executable to use to deinstall database is located at $ORACLE_HOME/deinstall
There are different options you can use while executing the deinstall command. You can generate a response file using –checkonly option. You can edit this response file to modify any parameter values or use it directly with the deinstall command to remove the Database software. When it comes to know what is being deleted as part of deinstall process, it removes the following files and directory contents in the Oracle base directory if the central inventory contains no other registered Oracle Homes.
- admin
- cfgtoollogs
- checkpoints
- diag
- oradata
- fast_recovery_area
The following syntax of Deinstall is extracted from Oracle Document for reference.
(./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] [-skipLocalHomeDeletion] [-skipRemoteHomeDeletion] [-help]
The following session log details the creation of response file using –checkonly option.
[oracle@askm18c deinstall]$ ./deinstall -checkonly
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2018-08-12_10-02-38PM/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/18.0.0/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 STARTNetwork de-configuration trace file location: /tmp/deinstall2018-08-12_10-02-38PM/logs/netdc_check2018-08-12_10-04-05PM.log
Specify all Single Instance listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:LISTENER
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /tmp/deinstall2018-08-12_10-02-38PM/logs/databasedc_check2018-08-12_10-04-05PM.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 [db18c]: db18c
###### For Database 'db18c' ######
Single Instance Database
The diagnostic destination location of the database: /u01/app/oracle/diag/rdbms/db18c
Storage type used by the Database: FS
Database file location: /u01/app/oracle/oradata/DB18C,/u01/app/oracle/recovery_area/DB18C
Fast recovery area location: /u01/app/oracle/recovery_area/DB18C
database spfile location: /u01/app/oracle/product/18.0.0/dbhome_1/dbs/spfiledb18c.oraThe details of database(s) db18c have been discovered automatically. Do you still want to modify the details of db18c database(s)? [n]: n
Database Check Configuration END
######################### DECONFIG CHECK OPERATION END #########################
####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Home selected for deinstall is: /u01/app/oracle/product/18.0.0/dbhome_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Single Instance listener(s) will be de-configured: LISTENER
The following databases were selected for de-configuration : db18c
Database unique name : db18c
Storage used : FS
Location of response file generated: '/tmp/deinstall2018-08-12_10-02-38PM/response/deinstall_OraDB18Home1.rsp'
A log of this session will be written to: '/tmp/deinstall2018-08-12_10-02-38PM/logs/deinstall_deconfig2018-08-12_10-04-02-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2018-08-12_10-02-38PM/logs/deinstall_deconfig2018-08-12_10-04-02-PM.err'############# ORACLE DECONFIG TOOL END #############
[oracle@askm18c deinstall]$
Now the response file is created. We can use this response file to deinstall Oracle Database. These responses are valid to use to deinstall Oracle Database if you don’t use –checkonly option. Then it removes the software without response file creation.
Following session log shows how to use the response file created above.
[oracle@askm18c deinstall]$ ./deinstall -paramfile /tmp/deinstall2018-08-12_10-02-38PM/response/deinstall_OraDB18Home1.rsp
Checking for required files and bootstrapping ...
Please wait ...
Using properties file /tmp/deinstall2018-08-12_10-02-38PM/response/deinstall_OraDB18Home1.rsp
Location of logs /tmp/deinstall2018-08-12_10-02-38PM/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/18.0.0/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 STARTNetwork de-configuration trace file location: /tmp/deinstall2018-08-12_10-02-38PM/logs/netdc_check2018-08-12_10-25-36PM.log
Specify all Single Instance listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:LISTENER
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /tmp/deinstall2018-08-12_10-02-38PM/logs/databasedc_check2018-08-12_10-25-36PM.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 [db18c]: db18c
###### For Database 'db18c' ######
Single Instance Database
The diagnostic destination location of the database: /u01/app/oracle/diag/rdbms/db18c
Storage type used by the Database: FS
Database file location: /u01/app/oracle/oradata/DB18C,/u01/app/oracle/recovery_area/DB18C
Fast recovery area location: /u01/app/oracle/recovery_area/DB18C
database spfile location: /u01/app/oracle/product/18.0.0/dbhome_1/dbs/spfiledb18c.oraThe details of database(s) db18c have been discovered automatically. Do you still want to modify the details of db18c database(s)? [n]: n
Database Check Configuration END
######################### DECONFIG CHECK OPERATION END #########################
####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Home selected for deinstall is: /u01/app/oracle/product/18.0.0/dbhome_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Single Instance listener(s) will be de-configured: LISTENER
The following databases were selected for de-configuration : db18c
Database unique name : db18c
Storage used : FS
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2018-08-12_10-02-38PM/logs/deinstall_deconfig2018-08-12_10-25-34-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2018-08-12_10-02-38PM/logs/deinstall_deconfig2018-08-12_10-25-34-PM.err'######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2018-08-12_10-02-38PM/logs/databasedc_clean2018-08-12_10-25-36PM.log
Database Clean Configuration START db18c
This operation may take few minutes.
Database Clean Configuration END db18cNetwork Configuration clean config START
Network de-configuration trace file location: /tmp/deinstall2018-08-12_10-02-38PM/logs/netdc_clean2018-08-12_10-25-36PM.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 #######################
Successfully de-configured the following database instances : db18c
Following Single Instance listener(s) were de-configured successfully: LISTENER
#######################################################################
############# ORACLE DECONFIG TOOL END #############Using properties file /tmp/deinstall2018-08-12_10-02-38PM/response/deinstall_OraDB18Home1.rsp
Location of logs /tmp/deinstall2018-08-12_10-02-38PM/logs/############ ORACLE DEINSTALL TOOL START ############
####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/tmp/deinstall2018-08-12_10-02-38PM/logs/deinstall_deconfig2018-08-12_10-25-34-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2018-08-12_10-02-38PM/logs/deinstall_deconfig2018-08-12_10-25-34-PM.err'######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to askm18c
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2018-08-12_10-24-33PM/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 STARTDetach Oracle home '/u01/app/oracle/product/18.0.0/dbhome_1' from the central inventory on the local node : Done
Delete directory '/u01/app/oracle/product/18.0.0/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/18.0.0/dbhome_1' from the central inventory on the local node.
Successfully deleted directory '/u01/app/oracle/product/18.0.0/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) 'askm18c' at the end of the session.Run 'rm -r /opt/ORCLfmap' as root on node(s) 'askm18c' at the end of the session.
Run 'rm -r /etc/oratab' as root on node(s) 'askm18c' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
############# ORACLE DEINSTALL TOOL END #############[oracle@askm18c deinstall]$
The session log prompts to remove some files and directories which are shown below.
[root@askm18c ~]# ls -lrt /etc/oraInst.loc /opt/ORCLfmap /etc/oratab
-rw-r--r--. 1 root root 56 Aug 12 03:09 /etc/oraInst.loc
-rw-rw-r--. 1 oracle oinstall 741 Aug 12 22:27 /etc/oratab/opt/ORCLfmap:
total 0
drwxr-xr-x. 1 root root 18 Aug 12 03:10 prot1_64
[root@askm18c ~]# rm -rf /etc/oraInst.loc /opt/ORCLfmap /etc/oratab
[root@askm18c ~]# ls -lrt /etc/oraInst.loc /opt/ORCLfmap /etc/oratab
ls: cannot access /etc/oraInst.loc: No such file or directory
ls: cannot access /opt/ORCLfmap: No such file or directory
ls: cannot access /etc/oratab: No such file or directory
[root@askm18c ~]#
Validate that the directories were removed after successfully deinstalling the Oracle Database.
[oracle@askm18c deinstall]$ cd $ORACLE_HOME
bash: cd: /u01/app/oracle/product/18.0.0/dbhome_1: No such file or directory
[oracle@askm18c deinstall]$ cd /u01/app/oracle
bash: cd: /u01/app/oracle: No such file or directory
[oracle@askm18c deinstall]$ cd /u01/app
[oracle@askm18c app]$ ls
[oracle@askm18c app]$
If you would like to remove the pre-install package you installed for completing the pre-requisites for Oracle Database Installation, you can use the following steps to remove the rpm package.
[root@askm18c ~]# rpm -qa | grep -i oracle
oraclelinux-release-7.4-1.0.4.el7.x86_64
oracle-logos-70.0.3-4.0.7.el7.noarch
oracle-database-preinstall-18c-1.0-1.el7.x86_64
[root@askm18c ~]# rpm -e oracle-database-preinstall-18c-1.0-1.el7.x86_64
[root@askm18c ~]# rpm -qa | grep -i oracle
oraclelinux-release-7.4-1.0.4.el7.x86_64
oracle-logos-70.0.3-4.0.7.el7.noarch
[root@askm18c ~]#
Important Notes :
One important point people keep asking me is that , do we need to keep the database down or up during the deinstallation process. Our answer is , it is optional. The deinstallation will not fail , instead it will shutdown any services running out of that Oracle Home we are deinstalling and then proceeds with the deinstallation. Please try this and comment here if you have any questions.
Hope this helps.
+ comments + 2 comments
Thanks for sharing that blog with us. If anyone here searching Oracle 12c Performance Tuning Certification then visit Akswave.
Don’t follow your role model. Be the Role model person for others. But it's so simple by getting Hadoop training in Chennai. Because it is an assurance course to bounce back from a double salary. For joining call 7502633633.
Post a Comment
Thank you for visiting our site and leaving your valuable comment.