Skip Headers
Oracle® Database Backup and Recovery Advanced User's Guide
10g Release 2 (10.2)

Part Number B14191-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

Dropping a Database with SQL*Plus

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 command DROP DATABASE

  1. 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
    
    
  2. 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.

  3. 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/*