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: Delete a datafile from a tablespace

Re: Delete a datafile from a tablespace

From: Anthony Hogan <ahogan-nospam-_at_iespana.es>
Date: Tue, 24 Jun 2003 09:54:04 +0100
Message-ID: <3EF811AC.55748408@iespana.es>

Billy Verreynne wrote:
>
> Hanne Iren Midttun wrote:
>
> > I have by accident added a datafile to the wrong tablespace. Can
> > somebody tip me on how can I delete it again?
>
> Look at the ALTER DATABASE command. You can offline/drop the file, or shrink
> it.
>
> > (Never - ever start working before 1 cup of coffee :-)
>
> In my case it is never post here until I have at least 2 or 3 cups.. or else
> I go thread hunting with a lead pipe... ;-)
>
> --
> Billy

Billy,
I'm not sure if this will work if the database is in archivelog mode. I tried this (8.1.7 archivelog):
>alter tablespace test add datafile 'c:\oracle\oradata\test\test2.ora' size 16k;

>alter database datafile 'c:\oracle\oradata\test\test2.ora' offline drop;

>shutdown

>startup

>select status from v$datafile; - Status of test2.ora is RECOVER

>recover database datafile 'c:\oracle\oradata\test\test2.ora';

>alter database datafile 'c:\oracle\oradata\test\test2.ora' online; -It's back again

I may be missing something but then again I'M still on my first cup of coffee :)

BTW The OP also has the option of recreating the tablespace having first either exported all the objects in the tablespace or moved them to another tablespace temporarily.

Anthony Hogan Received on Tue Jun 24 2003 - 03:54:04 CDT

Original text of this message

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