Wednesday, March 10, 2021

RMAN Database Dropping and Deregistration

There are 4 syntax available to drop the database using RMAN

1. DROP DATABASE;

2. DROP DATABASE NOPROMPT;

3. DROP DATABASE INCLUDING BACKUPS;

4. DROP DATABASE INCLUDING BACKUPS NOPROMPT;

When “NOPROMPT” is specified RMAN does not prompt for the confirmation before deleting the database.

The “DROP DATABASE” command deletes the

Datafiles

Logfiles

Controlfiles

Spfile

Database has be in EXCLUSIVE RESTRICTED MODE and on MOUNT state.

Lets put the database in exclusive restricted mode from RMAN session only,

SQL> STARTUP MOUNT;

RMAN> sql 'alter system enable restricted session';

Oracle 10g/11g/12c/19c allows a database to be dropped and its entry removed from the RMAN catalog. The following statement drops the entire database and removes the database files:

RMAN> drop database;

The statement below drops the entire database, removes the database files, and deletes all backup copies of the database and the archive log files:

RMAN> drop database including backups;

The two statements above drop the database and delete the database files.  However, they do not unregister the database from the RMAN catalog. The following statement will remove the database information from the RMAN catalog:

RMAN> unregister database grid;

This drops the database and deletes database files, logfiles, spfile and controlfile and bring the database instance down.