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 -> Oracle 10gR2 : drop empty datafiles !

Oracle 10gR2 : drop empty datafiles !

From: Matthias Hoys <idmwarpzone_NOSPAM__at_yahoo.com>
Date: Mon, 4 Jul 2005 22:50:17 +0200
Message-ID: <42c9a108$0$23341$ba620e4c@news.skynet.be>


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 Szasz 
Received on Mon Jul 04 2005 - 15:50:17 CDT

Original text of this message

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