A Better Way of Dropping Databases Through RMAN


We have found that we have been dropping databases without dropping the backup files in the Fast Recovery Area (FRA).

We have been using the DROP DATABASE command from SQL*Plus, and have found that we have accumulated several terabytes of unowned backups in the FRA.

A much better way to drop a database is to use the RMAN version of the command as shown in the following example (from the RMAN documentation):

CONNECT TARGET /
STARTUP FORCE DBA MOUNT
DROP DATABASE INCLUDING BACKUPS NOPROMPT;

The documentation also reminds one to be wary of the NOCATALOG mode as backups known to the RMAN catalague, but not known to the control file, are kept. In other words, in order to delete all known backups, run these commands in CATALOG mode.

Update 2015/06/01 Thanks to Franck Pachot (@FranckPachot) for pointing out the DBA option in the STARTUP command.

Update 2016/01/01 Corrected comment about NOCATALOG and CATALOG modes.

Advertisements

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