Completely uninstall Oracle server on Linux

oracleoracle-11g-r2

I have searched lot in Google for how to uninstall Oracle on Linux, but I can't figure it out.

I think that I need to reinstall the server because I get a lot of errors when I try to startup the server.

Does any one know how to completely remove all data belong to an Oracle server?

Best Answer

Oracle provides extensive documentation about how its database software can be uninstalled:

  • Removing Oracle Database Software - 11.2 - this is the new method for uninstallation, using the deinstall tool. This includes instructions on how to download the tool if your install failed and you can't use it directly from there.
  • Removing Oracle Database Software - 11.1 - this has step-by-step, part by part clean removal instructions for the various parts of the product you could have installed. These methods still work on 11gR2.

If there's anything of any value in the databases on that machine, a full backup is a must. Ideally make that data available on other database(s) on a separate machine before you start uninstalling anything – that way you're sure you won't actually be losing data even if you re-image the OS. (Re-installing the OS is sometimes the most efficient removal tool if you have good procedures/tooling for that.)


But if you're just having issues starting a database, a re-install isn't usually the right thing to do. Fixing those errors is usually much more productive – you'll actually learn something about how the software works along the way, and that's valuable.
To get help with that, if your searches in the Web and the Oracle support site have not helped so far, you could post a question here that includes:

  • The exact error message you get when you try starting up your database (or whatever action it is you're currently stuck with)
  • The relevant logs from your alert.log file (located usually in $ORACLE_BASE/diag/rdbms/<lowercase db name>/<SID/trace/alert_<SID>.log)
  • What changes you made since the last time the database worked
  • Anything else that you have noticed looks off

The more drastic option for uninstallation is simply to stop all services, and remove (delete) all the files that were installed. Be very careful if you go that route, as usual - don't nuke unrelated files. And make sure you have backups you know you can restore if there's anything useful in the database(s) you have installed.
The main directories/files that need cleaning up are:

  • $ORACLE_BASE and anything under it
  • $ORACLE_HOME and anything under it (you might have several)
  • /etc/ora* - this is the last thing to delete. /etc/oratab contains a list of your Oracle homes, so use it as a reference.
  • Scan your system for files belonging to the Oracle owner and dba group and remove what is now unnecessary.