Site icon IT Tutorial

ORA-10635: Invalid segment or tablespace type

I got ” ORA-10635: Invalid segment or tablespace type ” error in Oracle database.

 

ORA-10635: Invalid segment or tablespace type

Details of error are as follows.

SQL> alter table <table_name> enable row movement;
Table altered.

SQL> alter table <table_name> shrink space compact;
alter table <table_name> shrink space compact
*
ERROR at line 1:
ORA-10635: Invalid segment or tablespace type

 

 

This ORA-10635 error is related with the SHRINK clause is not valid on a compressed table and ORA-10635 is normally expected.
Bug 4076841 10.1.0.3 RDBMS 10.1.0.3 SQL LANGUAGE PRODID-5 PORTID-453
Abstract: ALTER TABLE SHRINK SPACE LIMITATIONS DID NOT INCLUDE COMPRESSED SEGMENTS
–> Status: 99,Closed, Documentation Bug Fixed

(b) Autosegment space management was not set for the tablespace. Shrink operations can be performed only on segments in locally managed tablespaces with automatic segment space management (ASSM). Within an ASSM tablespace, all segment types are eligible for online segment shrink except these:
* IOT mapping tables
* Tables with rowid based materialized views
* Tables with function-based indexes.

 

BTW: The SHRINK option is not supported for SecureFiles LOBs.

 

To solve this error, perform the following steps.

(a) In case of a table being compressed table:

SQL> conn / as sysdba
SQL> alter table <table_name> nocompress;
SQL> alter table <table_name> enable row movement;
SQL> alter table <table_name> shrink space compact;
SQL> exit

 

(b) If decompressing the table is not possible or if the decompression does not help, then the following workaround can add value:

SQL> conn / as sysdba
SQL> alter table <table_name> enable row movement;
SQL> alter table <table_name> move tablespace &tablespace_name;    --- the newly specified tablespace can be the same current one
SQL> alter table <table_name> shrink space compact;
SQL> exit

(c) In case autosegment space management is not set for the tablespace, please enable it. The way to “convert” to ASSM is to export all the objects from the MSSM tablespace, then create a new ASSM tablespace and finally import in this new one all the objects.

 

 

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

Exit mobile version