Saturday, February 13, 2016

ORA-10631: SHRINK clause should not be specified for this object

Cause : If your table contain function based Index you will get this error. 

Solution: Check your tables that contain relay function based index. Drop function based index and recreate index after Shrink completed.

SQL> ALTER TABLE ACCOUNTS ENABLE ROW MOVEMENT;

Table altered.

SQL> ALTER TABLE ACCOUNTS SHRINK SPACE;
ALTER TABLE ACCOUNTS SHRINK SPACE
*
ERROR at line 1:
ORA-10631: SHRINK clause should not be specified for this object


SQL> SELECT INDEX_NAME, INDEX_TYPE
FROM DBA_INDEXES
WHERE OWNER = 'CBS'
AND TABLE_NAME = 'ACCOUNTS';

INDEX_NAME                     INDEX_TYPE
------------------------------ ---------------------------
IDX_ACCOUNTS_ACTNUM_DATE       NORMAL
IDX_ACCOUNTS_GL   FUNCTION-BASED NORMAL
SYS_C00482673                  NORMAL

SQL> DROP INDEX IDX_ACCOUNTS_GL   ;

Index dropped.

SQL> ALTER TABLE ACCOUNTS SHRINK SPACE;

Table altered.

SQL>

No comments:

Post a Comment