Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Oracle 10gR2 : drop empty datafiles !
http://www.oracle.com/technology/pub/articles/10gdba/nanda_10gr2dba_part2.html
Drop Empty Datafiles
Imagine that you just added a datafile to the wrong directory or
tablespace-a fairly common error. All is not lost; the datafile doesn't
contain any data yet, so you can easily drop it, right?
Unfortunately, you can't. Prior to Oracle Database 10g Release 2, your only
clean option for removing a datafile is to drop the entire tablespace and
then rebuild it without that particular file. If the tablespace contains
data, you have to go through the time-consuming and laborious process of
storing the data on a separate location and reinstating it. In addition to
its inconvenience, this process makes the tablespace unavailable.
Thankfully, in Oracle Database 10g Release 2 the process has been
simplified: You can just drop the datafile. For example, the following
command will remove the indicated datafile from the tablespace as well as
from the server.
alter tablespace users drop datafile '/tmp/users01.dbf'
/
There are a couple restrictions, however: The datafile must be empty to be dropped. You can't drop the last datafile in a tablespace; the tablespace itself must be dropped. And the tablespace must be online and in read-write status.
-- If you talk to God, you are praying. If God talks to you, you have schizophrenia. - Thomas SzaszReceived on Mon Jul 04 2005 - 15:50:17 CDT