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

Home -> Community -> Usenet -> c.d.o.server -> Re: How do I get rid of this @$# database.

Re: How do I get rid of this @$# database.

From: Cheng-Jih Chen <cjc_at_interport.net>
Date: 17 Sep 1998 16:24:55 -0400
Message-ID: <6trr6n$147$1@interport.net>


Posted and mailed.

In article <36014DC2.DC4_at_bloomberg.net>, Art S. Kagel <kagel_at_bloomberg.net> wrote:
>I have installed Oracle 8.whatever and let the installer create my
>database. It was created in filesystem space. I'd like to recreate it
>in RAW device space but I do not know how to get rid of the database so
>I can recreate it. OK so I'm an old Informix bigot and I like the SQL
>DROP DATABASE statement, but that asside, how do I do this?
>
>Art S. Kagel
>Willing to take Oracle DBA classes as soon as this rush is over....

Heh, heh. I started on Informix 5, skipped over to 7.2/7.3 before moving on to Oracle. There's no good analog of an Informix "database" in Oracle. The closest thing is Oracle's notion of a schema. But that's neither here nor there.

Anyway, to delete the Oracle database more or less means getting a list of where all the files are, shutting down the instance, and then doing rm on these files. I don't know where the installer insists on dumping datafiles, but you can get a list of them by going into sqlplus and querying the v$datafile view:

  select name from v$datafile;

In sqlplus, you can run "desc <table name>" to get structures for tables and views. "desc v$datafile" if you want more info.

You can also issue "spool <filename>" to spool sqlplus output to <filename>. With the above query, you can edit the output to put "rm " in from of each file. Arguably, you can run:

  select "rm " || name from v$datafile;

for similar effect.

You may want to issue

  set pagesize 9999
  set line 132

before spooling off to file, mainly to format the output. sqlplus assumes something like an 80x25 screen, and will put headers and wrap text to that.

OK, those are the datafiles. You'll need the locations of your redo log files as well as control files now.

For the logfiles, run:

  select member from v$logfile;

For the controlfiles, run:

  select value from v$parameter where name = 'control_files';

At this point, you can shutdown the instance from server manager, then go and delete the files.

You may also want to zap the initialization parameters files, which are located in $ORACLE_HOME/dbs. Received on Thu Sep 17 1998 - 15:24:55 CDT

Original text of this message

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