Are you deallocating Unused Space or wanting to Shrink the data back to beginning of the tablespace?
Segment shrink is an online, in-place operation. DML operations and queries can be issued during the data movement phase of segment shrink. Concurrent DML operation are blocked for a short time at the end of the shrink operation, when the space is deallocated. Indexes are maintained during the shrink operation and remain usable after the operation is complete. Segment shrink does not require extra disk space to be allocated.
Segment shrink requires that rows be moved to new locations. Therefore, you must first enable row movement in the object you want to shrink and disable any rowid-based triggers defined on the object. You enable row movement in a table with the ALTER TABLE ... ENABLE ROW MOVEMENT command.
Some examples:
Shrink a table and all of its dependent segments (including LOB segments):ALTER TABLE employees SHRINK SPACE CASCADE;
Shrink a LOB segment only:ALTER TABLE employees MODIFY LOB (perf_review) (SHRINK SPACE);
When you deallocate unused space, the database frees the unused space at the unused (high water mark) end of the database segment and makes the space available for other segments in the tablespace.
Some examples:
ALTER TABLE table DEALLOCATE UNUSED KEEP integer;
ALTER INDEX index DEALLOCATE UNUSED KEEP integer;
ALTER CLUSTER cluster DEALLOCATE UNUSED KEEP integer;
LS
"640KB ought to be enough for anybody." - Bill Gates, 1981
Oracle LazyDBA home page