Wednesday 24 June 2015

      DROP DATABASE WITH BACKUPS USING RMAN





Prerequisites:

. The target database must be mounted exclusive and not open, and started in RESTRICT mode.
  Connect to RMAN but do not connect to recovery catalog.


Semantics:

Syntax Element  Description
INCLUDING BACKUPS  option  deletes backup sets, proxy copies, image copies, and archived redo logs associated with the target database from all configured device types.

If you are using a recovery catalog but running RMAN in NOCATALOG mode when you drop the database, then RMAN will not delete any backups which are known to the recovery catalog but no longer exist in the target database control file.


NOPROMPT  option ensures that RMAN  does not prompt for confirmation before deleting the database.



In this example, you want to delete a test database called DEVDB that is registered in the recovery catalog. You start the RMAN client, connect to database DEVDB as TARGET, and connect to the recovery catalog. You then run the following commands to delete the target database files, as well as all backups, copies, and archived logs associated with the database:

RMAN> CONNECT TARGET SYS@DEVDB<mailto:SYS@DEVDB>
target database Password: password
connected to target database: DEVDB (DBID=43515711)
RMAN> STARTUP FORCE MOUNT
RMAN> SQL 'ALTER SYSTEM ENABLE RESTRICTED SESSION';
RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;









No comments:

Post a Comment