Deinstalling Oracle Database 12.2.0.1

Deinstalling Oracle Database 12.2.0.1This is part of a blog post serious where I install Oracle 18c on-premises in our Hands-On Lab and upgrade the Multitenant 12.2.0.1 database as well. But in order to safe space, deinstalling Oracle Database 12.2.0.1 is my next task. You find all the blog posts connected to each other here:

Deinstalling Oracle Database 12.2.0.1

In the Oracle Installation documentation you’ll find this part:

The documentation lists two removal options:

But in fact (see below) there’s actually no difference. The deinstall tool is nothing else than a wrapper for the OUI -deinstall option. No idea why somebody made it look like as if would be really two different things.

In both cases you will need to protect the following directories first:

  • $ORACLE_HOME/dbs
  • $ORACLE_HOME/network/admin
  • $ORACLE_BASE/admin
  • $ORACLE_BASE/cfgtoollogs
  • $ORACLE_BASE/checkpoints
  • $ORACLE_BASE/diag
  • $ORACLE_BASE/fast_recovery_area
  • $ORACLE_BASE/oradata

Especially the latter should be protected in case your database(s) sit underneath $ORACLE_BASE/oradata.

Removing Oracle Database 12.2.0.1 in the Hands-On Lab

In my particular case I protect the following directory contents first and copy them to a subdirectory in /home/oracle:

  • $ORACLE_HOME/dbs
  • $ORACLE_HOME/network/admin
  • $ORACLE_BASE/cfgtoollogs

And be very careful. Even though the listing in the documentation says, the removal process will remove $ORACLE_BASE/oradata this is somewhat incorrect. The process will remove the database(s) configured with the home if you are not deselecting the database(s):

cd $ORACLE_HOME/deinstall
./deinstall

Database Check Configuration START

Database de-configuration trace file location:
/u01/app/oraInventory/logs/databasedc_check2018-06-13_04-30-40-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 [CDB2]: .

At least one database from the discovered database list 'CDB2' is missing in the
specified database list ''. The oracle home will be cleaned up so all databases will
not be available after deinstall. If you want to remove a specific database, please
use dbca instead. Do you want to continue? [n]: y

Database Check Configuration END

You’ll have to answer with a dot (.) as otherwise – in case you hit RETURN – in this example CDB2 will be removed, even though it is not in $ORACLE_BASE/oradata.

Summary

Finally the deinstalltion process reports:

####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/oracle/product/12.2.0.1' from the
central inventory on the local node.
Successfully deleted directory '/u01/app/oracle/product/12.2.0.1' on the local node.
Oracle Universal Installer cleanup was successful.

Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'localhost'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete
'/u01/app/oracle' and its contents.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

Final check:

$ ls -lrt /u02/oradata/
total 20
drwxr-x---. 2 oracle dba 4096 Jul  8  2016 FTEX
drwxr-x---. 4 oracle dba 4096 Aug 12  2016 CDB1
drwxr-x---. 5 oracle dba 4096 Jan 13  2017 CDB2
drwxr-x---. 2 oracle dba 4096 Feb  8  2017 UPGR
drwxr-x---. 2 oracle dba 4096 Feb  8  2017 DB12

All set, my database is still there. And I have protected my configuration files as well since I copied them upfront.

–Mike

Leave a Reply

Your email address will not be published. Required fields are marked *

* Checkbox to comply with GDPR is required

*

I agree

This site uses Akismet to reduce spam. Learn how your comment data is processed.