You may need to remove a database from the operating system. For example, you create a test database and then no longer have a use for it. In such a situation, use the DROP
DATABASE
command from within RMAN, or the DROP
DATABASE
statement in SQL*Plus.
DROP
DATABASE
requires that RMAN be connected to the target database, and that the target database be mounted. The command does not require connection to the recovery catalog. If RMAN is connected to the recovery catalog, and if you specify the option INCLUDE
COPIES
AND
BACKUPS
, then RMAN also unregisters the database.
See Also:
Oracle Database Backup and Recovery Advanced User's Guide to learn how to use the SQL*PlusDROP
DATABASE
commandTo drop a database:
Connect RMAN to the target database and (optionally) recovery catalog. For example:
rman TARGET / CATALOG rman/rman@catdb
Catalog all backups that are associated with the database. For example, the following commands catalogs files in the flash recovery area, and then in a secondary archiving destination:
RMAN> CATALOG START WITH '+disk1'; # all files from flash recovery area # (stored on ASM disk) RMAN> CATALOG START WITH '/arch_dest2'; # all files from second arch dest
Delete all backups and copies associated with the database. For example:
RMAN> DELETE BACKUPSET; # deletes all backups RMAN> DELETE COPY; # delete all image copies (including archived logs)
Remove the database from the operating system (and automatically unregister it from the recovery catalog if you are connected to the catalog). For example:
DROP DATABASE; # delete all database files and unregister the database