View Full Version : Packing or freeing datafiles?
Guest
05-04-2005, 06:08 AM
We have a tablespace that is now much bigger than needed to
hold the data in it, and I would like to shrink it.
However, all datafiles have some extents allocated near the end of the
file,
so cannot just downsize them.
Is it possible to first move all allocated extents away from one
datafile to another,
or to "pack" a datafile, i.e. move all extents to the beginning of the
file.
I only have access thru TOAD, no OEM, so would need the SQL-commands
(Oracle 9i).
Any help appreciated.
Steve Howard
05-04-2005, 06:30 AM
Look up "alter table move" and "alter index rebuild" in the doco.
Regards,
Steve
Guest
05-04-2005, 08:58 AM
Hi Steve,
Yes, I know about those...
that you can tell in what tablespace to rebuild the table.
But it doesnt really give me control of in what DATAFILE
or at what positions within a file to use for the rebuild,
does it?
stephen.how...@us.pwcglobal.com wrote: Look up "alter table move" and "alter index rebuild" in the doco. Regards, Steve
Access
05-04-2005, 09:28 AM
<grz01@spray.se> wrote in message
news:1115225892.974577.199860@g14g2000cwa.googlegroups.com... Hi Steve, Yes, I know about those... that you can tell in what tablespace to rebuild the table. But it doesnt really give me control of in what DATAFILE or at what positions within a file to use for the rebuild, does it?
No. What you could is : create a new tablespace, do ALTER TABLE MOVE to move
the tables to the new tablespace, then drop the old tablespace.
stephen.how...@us.pwcglobal.com wrote: Look up "alter table move" and "alter index rebuild" in the doco. Regards, Steve
Yong Huang
05-04-2005, 10:06 AM
Other than moving it to a new tablespace (as Matthias says), run "alter
table move" once. Assuming your tablespace is LMT, the table blocks
should migrate toward the beginning of the file. (Ref. Jonathan Lewis,
"Practical Oracle8i", pp.153-4)
It seems that when you do it again, or more correctly, even number of
times, the blocks migrate back.
Yong Huang
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.