I wondered the same thing and advised him to check out the alter table move command. You can even specify the degree of parallelism, and whether or not to do it online. Not to mention it is nearly a onestep operation. I wonder if its an Oracle version thing or a lead your horse to water thing...
-----Original Message-----
From: Michael Peel [mailto:oracledba-ezmlmshield-x67437006.[Email address protected]
Sent: Thursday, March 27, 2008 5:09 AM
To: LazyDBA Discussion
Subject: RE: Deleting a datafile from a tablespace.
Why not just create a new TS, move all your objects, then drop the old one?
Michael Peel
-----Original Message-----
From: james [mailto:oracledba-ezmlmshield-x22498652.[Email address protected]
Sent: 27 March 2008 06:40
To: LazyDBA Discussion
Subject: RE: Deleting a datafile from a tablespace.
YOU CAN TRY ONE THING
1) EXPORT ALL TABLES ( WITH DATA / PROCEDURES / FUNCTIONS) ETC
2) DROP TABLESPACES
3) RECREATE TABLESPACE WITH REDUCED SIZE AS REQUIRED .
YOU CAN CREATE WITH SINGLE DATAFILE.
4) IMPORT TABLES
5) YOU WILL HAVE TO DO THIS WITH ALL YOUR TABLESPACES
TAKE ALL BACKUPS BEFORE YOU TRY THIS
-----Original Message-----
From: Ricardo Portilho Proni
[mailto:oracledba-ezmlmshield-x50869929.[Email address protected]
Sent: Thursday, March 27, 2008 7:03 AM
To: LazyDBA Discussion
Subject: Re: Deleting a datafile from a tablespace.
Once you use a datafile, you canīt drop it if you still have data in the
tablespace.
Export the data and import in another tablespace, using another datafiles.
1. Will the system allow me to drop the datafile if there is data in it and
it is offline?
- No.
2. How do I transfer data from one Dbf of tbs to other? that is,
If the tablespace A has 2 dbf's - A1.dbf and A2.dbf , how do I transfer the
data from A2.dbf to A1.dbf ?
- You donīt. Think data are logical, and resides in the Tablespace, a
logical unit, not in Datafiles, wich are physical.
3. Is export of tablespace --> drop tablespace --> recreate tablespace -->
import data to the new tablespace, the only option??
- Itīs you best option, I guess.
4. Will resizing the datafile to 0K as in "" Alter database datafile
'Path_of_datafile' resize 0 K; "" force the data to move from one dbf to
other of the same tbs? Or will it throw an error ,. since it has data more
than 0K size???
- It will shrink down the datafile to the High Water Mark, not to 0. And
even this wonīt work the way you want if you are using raw devices as
datafiles.
Ricardo Portilho Proni
Oracle Database 10g Certified Associate
Oracle Database 10g Certified Professional
Microsoft Certified Professional
Nerv Informática Ltda.
http://www.nervinformatica.com
http://www.pergunteaodba.net
Sheryl wrote:
> Hi All,
>
> My prod DB is a 2-node Oracle 10g R1 RAC on HP-UX. The datafiles reside on
RAW Device.
>
> We are presently doing a resizing of the Db. As a part of this activity we
were re-allocating the space from those Tablespaces that don't have much
usage , to the others with greater space usage.
>
> I have a tablespace of 16 GB - two datafiles each of 8GB. But the space
utilization is approx 1 GB. And the data is not expected to grow much for
this tablespace. So I want to drop one of the datafiles associated with this
tablespace. The data is spread over both the datafiles.
>
> To do the dropping of the datafile I have the following statements,
>
> Either
>
> Alter database datafile 'Path_of_datafile' offline;
> Alter database datafile 'Path_of_datafile' drop;
>
> Or
>
> Alter database datafile 'Path_of_datafile' offline drop;
>
> Now my queries are:-
>
> 1. Will the system allow me to drop the datafile if there is data in it
and it is offline?
> 2. How do I transfer data from one Dbf of tbs to other? that is,
> If the tablespace A has 2 dbf's - A1.dbf and A2.dbf , how do I transfer
the data from A2.dbf to A1.dbf ?
> 3. Is export of tablespace --> drop tablespace --> recreate tablespace -->
import data to the new tablespace, the only option??
> 4. Will resizing the datafile to 0K as in "" Alter database datafile
'Path_of_datafile' resize 0 K; "" force the data to move from one dbf to
other of the same tbs? Or will it throw an error ,. since it has data more
than 0K size???
>
>
> Thanks in advance,
>
> Warm Regards,
>
> Sheryl Philip
>
>
>
> DISCLAIMER:
> This message contains privileged and confidential information and is
intended only for an individual named. If you are not the intended
recipient, you should not disseminate, distribute, store, print, copy or
deliver this message. Please notify the sender immediately by e-mail if you
have received this e-mail by mistake and delete this e-mail from your
system. E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed, arrive late
or incomplete or contain viruses. The sender, therefore, does not accept
liability for any errors or omissions in the contents of this message which
arise as a result of e-mail transmission. If verification is required,
please request a hard-copy version.
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>
>
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
**********************************************************************
This e-mail is confidential and may be privileged.
It may only be read, copied and used by the intended recipient.
If you have received it in error please contact the sender immediately
by return e-mail. Please then delete the e-mail and any copies of it
and do not use or disclose its contents to any person.
**********************************************************************
Registered Office: Farncombe House, Broadway, Worcestershire, WR12 7LJ
AccuRead Limited Registered Number: 3076187 England
GSL UK Limited Registered Number: 3333860 England
Global Solutions Limited Registered Number: 3189802 England
**********************************************************************
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
______________
The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________
Oracle LazyDBA home page