Alejandro Vargas' Blog

  • March 22, 2007

10g Drop Database Command

Alejandro Vargas
Technical Leader, ACS Global Delivery, Infrastructure & BigData

I'm testing cloning using RMAN, working with small databases, I'm performing several clones with different approaches, trying to find an optimal way to perform automatized cloning on demand.

As part of the tests I'm using the Drop Database command, that made a fast and efficient cleanup of all datafiles, redologs and control files in one command. That way I'm ready to execute the next clone immediately.

Drop database do require to mount the database in exclusive restricted mode, that made quite difficult to execute it by mistake on the wrong database.

The steps are as follows:

  • shutdown abort;
  • startup mount exclusive restrict;
  • drop database;
This is a sample session using this feature:

1) Check Datafile, Controlfile and Online log names before drop database

SQL> select name from v$datafile;


SQL> select member from v$logfile;


6 rows selected.

SQL> select name from v$controlfile;


SQL> select name from v$database;


2) Drop Database

SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount exclusive restrict;
ORACLE instance started.

Total System Global Area  989855744 bytes
Fixed Size                  2077552 bytes
Variable Size             864029840 bytes
Database Buffers          117440512 bytes
Redo Buffers                6307840 bytes
Database mounted.
SQL> drop database;

Database dropped.

Disconnected from Oracle Database 10g Enterprise Edition Release - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

3) Check Datafile/Redologs/Controlfile after drop database

[dbtst2] > ls -ltr /dbtst/oa01/r2dupl/R2DUPL/datafile
ls: /dbtst/oa01/r2dupl/R2DUPL/datafile: No such file or directory

[dbtst2] > ls -ltr /dbtst/oa01/r2dupl/files1/R2TAPE/controlfile/
total 0
[dbtst2] > ls -ltr /dbtst/oa01/r2dupl/files2/R2TAPE/controlfile/
total 0

[dbtst2] > ls -ltr /dbtst/oa01/r2dupl/files1/R2DUPL/onlinelog/
ls: /dbtst/oa01/r2dupl/files1/R2DUPL/onlinelog/: No such file or directory
[dbtst2] > ls -ltr /dbtst/oa01/r2dupl/files2/R2DUPL/onlinelog/
ls: /dbtst/oa01/r2dupl/files2/R2DUPL/onlinelog/: No such file or directory

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.