Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-01 |
|
|
View PDF |
You may need to remove a database, that is, the database files that form the database, from the operating system. For example, this scenario can occur when you create a test database and then no longer have a use for it. The SQL*Plus command DROP
DATABASE
can perform this function.
See Also: Oracle Database Backup and Recovery Basics to learn how to use the equivalent RMAN commandDROP DATABASE |
Start SQL*Plus and connect to the target database with administrator privileges, then ensure that the database is either mounted or open with no users connected. For example:
SQL> STARTUP FORCE MOUNT
Remove the datafiles and control files listed in the control file from the operating system. For example:
SQL> DROP DATABASE; # deletes all database files, both ASM and non-ASM
If the database is on raw disk, the command does not delete the actual raw disk special files.
Use an operating system utility to delete all backups and archived logs associated with the database because these are not automatically deleted by the SQL*Plus command. For example:
% rm /backup/* ?/oradata/trgt/arch/*