In sweet memories of my ever loving brother "kutty thambi " ARUN KUMAR

Thursday, May 31, 2012

Drop Database Command Demo

From 10g onwards, we have Drop Database command, that made a fast and efficient cleanup of all datafiles, redologs and control files in one command.


Drop database do require to mount the database in exclusive restricted mode.

The steps are as follows:

•shutdown abort;

•startup mount exclusive restrict;

•drop database;

Here is a Demo:-
 
$ . oraenv


ORACLE_SID = [oracle] ? miadev07

The Oracle base for ORACLE_HOME=/u01/app/oracle/product/10.2.0.4 is /u01/app/oracle/product/10.2.0.4

dev07: /home/oracle

$ sqlplus / as sysdba



SQL*Plus: Release 10.2.0.4.0 - Production on Wed May 30 18:46:37 2012



Copyright (c) 1982, 2007, Oracle. All Rights Reserved.



Connected to an idle instance.


SQL> startup mount exclusive restrict;

ORACLE instance started.



Total System Global Area 1073741824 bytes

Fixed Size 2089472 bytes

Variable Size 390073856 bytes

Database Buffers 675282944 bytes

Redo Buffers 6295552 bytes

Database mounted.

SQL> select name from v$datafile;



NAME

--------------------------------------------------------------------------------

+DG1/miadev07/datafile/system.342.712614251

+DG1/miadev07/datafile/undotbs1.269.712587099

+DG1/miadev07/datafile/sysaux.311.712587103

+DG1/miadev07/datafile/users.315.712587107



SQL> select member from v$logfile;



MEMBER

--------------------------------------------------------------------------------

+DG1/miadev07/onlinelog/group_3.351.712625873

+DG1/miadev07/onlinelog/group_2.350.712625871

+DG1/miadev07/onlinelog/group_1.349.712625871



SQL> select name from v$controlfile;



NAME

--------------------------------------------------------------------------------

+DG1/miadev07/controlfile/current.348.712625853



SQL> drop database;



Database dropped.



Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit

Check Datafile/Redologs/Controlfile after drop database in ASM/File system. it will not available.
 
Regards,
Rajesh Kumar Govindarajan.


free counters
 
Share/Bookmark