Thursday, 9 June 2011

Drop database in oracle 10+

I'm still a bit green with Oracle but when deleting and recreating test db's I previously had always shutdown and deleted the data-files and the init files, but just discovered that as of oracle 10 you have a drop database command.  Obv you can't drop a live db so you must shutdown and mount it in restricted mode:

shutdown abort;
startup mount exclusive restrict;
drop database;
Simple as that!

Don't forget to remove the previous db's entry from oratab.

Oracle docs for cmd here.

No comments: