Oracle Tip: Dropping a Database

Here is how to drop a database in Oracle.

Make sure that have ORACLE_SID set first.

Log into sqlplus with sysdba privileges:

sqlplus /nolog
connect / as sysdba

Run the following commands in sqlplus:

shutdown immediate
startup restrict mount exclusive

Before you complete the drop, verify that you are in the correct database — the one that you want to drop (thanks to Dan Norris’ comment):

select * from v$database;

Now you can drop the database.

drop database;

2 Responses to “Oracle Tip: Dropping a Database”

  1. Dan Norris Says:

    I think I might include a “select * from v$database;” just before that “drop database;” statement. 🙂

  2. digitaleagle Says:

    That is a great point. Thanks for the suggestion.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: