« How To Add an Instance to a 10g RAC Using Database Control, Step by Step | Main | Rman Comparative Backup Sizes Using Backupset, Compressed Backupset and Backup As Copy »

10g Drop Database Command

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;

NAME
--------------------------------------------------------------------------------
/dbtst/oa01/r2dupl/R2DUPL/datafile/o1_mf_system_304kfl61_.dbf
/dbtst/oa01/r2dupl/R2DUPL/datafile/o1_mf_undotbs1_304kdoxf_.dbf
/dbtst/oa01/r2dupl/R2DUPL/datafile/o1_mf_sysaux_304kdrwx_.dbf
/dbtst/oa01/r2dupl/R2DUPL/datafile/o1_mf_users_304kgyyt_.dbf

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/dbtst/oa01/r2dupl/files1/R2DUPL/onlinelog/o1_mf_3_304klfwo_.log
/dbtst/oa01/r2dupl/files2/R2DUPL/onlinelog/o1_mf_3_304klhsq_.log
/dbtst/oa01/r2dupl/files1/R2DUPL/onlinelog/o1_mf_2_304klb3f_.log
/dbtst/oa01/r2dupl/files2/R2DUPL/onlinelog/o1_mf_2_304kld4z_.log
/dbtst/oa01/r2dupl/files1/R2DUPL/onlinelog/o1_mf_1_304kl63j_.log
/dbtst/oa01/r2dupl/files2/R2DUPL/onlinelog/o1_mf_1_304kl81x_.log

6 rows selected.

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/dbtst/oa01/r2dupl/files1/R2TAPE/controlfile/r2dup_1.ctl
/dbtst/oa01/r2dupl/files2/R2TAPE/controlfile/r2dup_2.ctl

SQL> select name from v$database;

NAME
---------
R2DUPL

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 10.2.0.3.0 - 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





TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mte1521/mt-tb.cgi/4342

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on March 22, 2007 5:22 AM.

The previous post in this blog was How To Add an Instance to a 10g RAC Using Database Control, Step by Step.

The next post in this blog is Rman Comparative Backup Sizes Using Backupset, Compressed Backupset and Backup As Copy.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle