Home > Oracle blogroll, Oracle DBA > How to Drop Oracle Database ?

How to Drop Oracle Database ?

CAUTION : DO NOT PERFORM THIS OPERATION IN YOUR PRODUCTION DATABASE FOR TESTING PURPOSE 🙂

With Oracle 10g release, Oracle Inc. has provided a sql command to Drop Database. Prior to Oracle 10g, the DBA had to physically delete the relevant files ( such as data files, control files, online redo log files & spfile )used by Oracle Database.

To drop the database, before even connecting the SQL prompt , make sure you have specified correct ORACLE_SID. You do not want to drop another db by accident.

Once you have specified/verified correct ORACLE_SID variable, now you need to shutdown the database via sql

SQL> Shutdown immediate;

Now, you need to to bring the database in exclusive restrictive mount mode

SQL> startup mount exclusive restrict;

Mount Database in exclusive restrict mode
Now just issue the drop database command

SQL> drop database;

Drop Database

NOTE : You can also perform whole of this activity via GUI utility provided by Oracle which is called dbca ( search for binary dbca in $ORACLE_HOME/bin dir) . That utility will behind the scenes take care of starting db in mount restrict mode & then based on your selection of db that you would want to drop, it will do so.

In case this activity was performed on windows server, then you need to also execute following command to remove service

oradim -DELETE -SID <name of instance>

 

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: