How to drop an Oracle Database?

To drop an Oracle database, we can use following RMAN command sequence

$ rman target /

RMAN> shutdown immediate;

RMAN> startup mount;

RMAN> sql ‘alter system enable restricted session’;

RMAN> allocate channel for maintenance type disk;

RMAN> DROP DATABASE;
OR
RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

When we are dropping the database, we should see following in alertTESTDB.log

It will drop all OMF files like data, online log, flashback etc.

Deleted Oracle managed file +DATA1/TESTDB/datafile/sysaux.329.645894375
Deleted Oracle managed file +DATA1/TESTDB/datafile/users.262.645894379
Deleted Oracle managed file +DATA1/TESTDB/datafile/data_tbs.267.645901915
Deleted Oracle managed file +DATA1/TESTDB/datafile/undotbs_1.330.645894371

Deleted Oracle managed file +DATA1/TESTDB/onlinelog/group_1.260.646053661
Deleted Oracle managed file +FLASH1/TESTDB/onlinelog/group_1.4898.646053663
Deleted Oracle managed file +DATA1/TESTDB/onlinelog/group_2.269.646053665
Deleted Oracle managed file +FLASH1/TESTDB/onlinelog/group_2.4907.646053665
Deleted Oracle managed file +DATA1/TESTDB/onlinelog/group_3.265.646053667
Deleted Oracle managed file +FLASH1/TESTDB/onlinelog/group_3.4909.646053669

Deleted Oracle managed file +FLASH1/TESTDB/flashback/log_1.4673.646053629
Deleted Oracle managed file +FLASH1/TESTDB/flashback/log_2.4670.646053829
Deleted Oracle managed file +FLASH1/TESTDB/flashback/log_3.4667.646053869
Deleted Oracle managed file +FLASH1/TESTDB/flashback/log_4.4666.646053907

If we use INCLUDING BACKUPS clause, it will also drop known backups from FRA (Flash Recovery Area).

Advertisements
This entry was posted in Oracle Database Architecture, Oracle Recovery Manager and tagged . Bookmark the permalink.

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