Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Dropping an entire database

Re: Dropping an entire database

From: Matt Reeves <mreeves_at_divcomp.com>
Date: 17 Dec 2001 07:13:05 -0800
Message-ID: <14259772.0112170713.b49d0c2@posting.google.com>


Hi Stephane,

If you run the following script and then execute the output at the OS, it will drop the entire database. This is quick, easy (maybe too much so) and it works on any version of Oracle on any platform. (On NT substitute "DEL" for "RM").

set pagesize 0
set feedback off

select 'rm ' || file_name from dba_data_files union all
select 'rm ' || member from v$logfile
union all
select 'rm ' || name from v$controlfile

spool drop.sh
/
spool off

You may also want to manually do the following to remove ALL traces of the database. These steps are NOT necessary if you plan to

  1. Remove the directory structures that contained the database files you just deleted from the script.
  2. Delete the initDBNAME.ora sgadef and password files.
  3. Remove references to the database from tnsnames.ora and sqlnet.ora as well as any nameing services.
  4. On NT you will also have to remove the services associated with the database you are dropping.

Hope this helps,

Matt Received on Mon Dec 17 2001 - 09:13:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US