This is part of a blog post series 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 save 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
- Installing Oracle Database 18.1.0
- Patching Oracle 18.1.0 to 18.2.0
- Upgrade Oracle 12.2.0.1 to Oracle Database 18c on-premises
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.
Additional Links
–Mike
Hallo Mike,
Thank you very much for your Posts that explain the Upgrade to 18c in a short and very informative way.
Oracle documentation do not explains fundamental Facts – e.g. that we do not need to create a new instance and only install the new Software in the Oracle Home – at least by no manuall Upgrades.
You say “But in fact (see below) there’s actually no difference.”. The Action is the same – removing the Software. But these are different Interfaces. Oracle Universal Installer Needs X-terminal or Response file. ‘deinstall’ tool is a command line Interface tool and do not need x-terminal and response file and is preferable in Unix environment.
best regards
Josef Schwertner
Thanks for your feedback, Josef!
And you are right.
Thanks
Mike
Hi Mike. In your example here, you launch deinstall while $ORACLE_HOME is the 12c home, not 18c home. Right? I upgraded my 18c to 19c. I launch deinstall after setting ORACLE_HOME to 18c home and deinstall shows:
…
The following nodes are part of this cluster: node1,node2
Active Remote Nodes are node2
ERROR: null
where node1 and node2 are the two nodes of my RAC. In /u01/app/oraInventory/logs/deinstall_deconfig2021-03-23_03-35-55-PM.err, I see
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
…
Caused by: java.lang.ExceptionInInitializerError
…
Caused by: java.lang.NullPointerException
…
I think I’ll open an SR about it.
Also, do you know if there’s any official statement about entering dot in response to “Specify the list of database names that are configured in this Oracle home”?
Lastly if you don’t mind. If I simply rm -rf my old home (18c), is there any bad consequence other than leaving an “ophaned” record in the inventory?
Thank you very much!
Hi Yong,
you please need to open an SR about this as you mentioned already.
Thanks,
Mike
Sorry. I just posted the previous message without research. The “ERROR: null” error can be solved by “export CV_ASSUME_DISTID=OL7” according to 2738856.1. I still wonder though. What’s *really* bad if I do “rm -rf “?
rm -rf does not clean up the inventory. And this is not a great idea as it will fall on your feet the sooner or later.
Cheers,
Mike
In your document, you mentioned to protect the following directories part. Yes, old Oracle_Home is /u01/app/oracle/product/12.1.0.2/dbhome_1, and new Oracle_Home is /u01/app/oracle/product/19.0.0.0/dbhome_1. They share Oracle_Base and these directories: $ORACLE_HOME/dbs
$ORACLE_HOME/network/admin
$ORACLE_BASE/admin
$ORACLE_BASE/cfgtoollogs
$ORACLE_BASE/checkpoints
$ORACLE_BASE/diag
$ORACLE_BASE/fast_recovery_area
You said to protect them by copy them to another directories. question is: after deinstalling 12c Home and copy these directories back, all old 12c files are still there. This is not what we need. We need these directories exist and only work for new Oracle 19c Home. Can you give me some tips on this? Thanks
Hi Frank,
then please open an SR and check with Oracle Support. The procedures change from release to release.
Sorry for the inconvenience – cheers
Mike