Shrink Space Check


Applies to:  Database Management Software Oracle 10.2.0.1 and Later

The "ALTER TABLE ... SHRINK SPACE CHECK" statement is used to verify as "ALTER TABLE SHRINK SPACE" does without actually performing shrink operation.

Suppose Table1 table does not have the row movement enabled, the statement will report the error without performing actual shrink operation:

SQL> ALTER TABLE Table1 SHRINK SPACE CHECK;
alter table Table1 shrink space check
*
ERROR at line 1:
ORA-10636: ROW MOVEMENT is not enabled

Enabled row movement in order to fix the error

SQL> ALTER TABLE test ENABLE ROW MOVEMENT;

Table altered.

Check again with same query:

SQL> ALTER TABLE Table1 SHRINK SPACE CHECK;
alter table Table1 shrink space check
*
ERROR at line 1:
ORA-10655: Segment can be shrunk

This is not an error message, but a confirmation message about the possibility of shrinking the segment.

No comments:

Post a Comment