Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Space Management: How to calculate UNDO space need to shrink a segment ?

Rajesh MenonDec 22 2009 — edited Dec 31 2009
Hello All,

We used to shrink Tables using the commands -

-- Enable row movement.
ALTER TABLE <owner>.<table> ENABLE ROW MOVEMENT;

-- Recover space for the object and all dependant objects.
ALTER TABLE <owner>.<table> SHRINK SPACE CASCADE;

We use to check the current UNDO tablespace usage, before these commands.

But some times this will fail with the below error !


ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO'

I suspect there should be enough UNDO space for this shrinking (At lease the size of the table, i think).

How can we calculate, the exact UNDO space required for a table to shrink..

Regards,
-Rajesh Menon
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2010
Added on Dec 22 2009
16 comments
5,209 views