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
DATABASE command from within RMAN, or the
DATABASE statement in SQL*Plus.
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
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*Plus
To 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