How to recreate the XE database in Oracle 11g Express

oracleoracle-11goracle-xe

My Oracle XE database was useless mess of unused tables etc. Using SqlPlus and several google results, I finally managed to drop the XE database, but now when I connect with SqlPLus IO cannot create a database. For any CREATE DATABASE command issue, I get back the error ORACLE not available.

I assume this is as I deleted the only db on that server, which only has room for one db, SqlPlus now gets confused as to how to connect, still trying to find XE. How can I connect as admin without connection to a db. so that I am connected to Oracle but not to a db? This seems to new the most likely solution.

Best Answer

You should have dropped the owners (AKA schemas AKA users that created the tables) of the "mess of unused tables." If you dropped the database, no way to restore it (unless you have a backup). Just recreate the database. And in the future you can drop just the non-system users, like to drop the Oracle Sample schema SCOTT:

drop user SCOTT cascade;