1 move Experiment
SQL> Create Table my_objects_move tablespace assm as select * From all_objects where rownum <20000;
Table created
SQL> Create index I _my_objects_move on my_objects_move (object_id );
Index created
SQL> Delete from my_objects_move where object_name like '% C % ';
7546 rows deleted
SQL> Delete from my_objects_move where object_name like '% u % ';
2959 rows deleted
SQL> commit;
Commit complete
SQL> ALTER TABLE my_objects_move move;
Table altered
SQL> select index_name, status
2 from user_indexes
3 where index_name = 'I _ my_objects_move ';
Index_name status
--------------------------------------
I _my_objects_move
Unusable
SQL> alter index I _my_objects_move rebuild;
Index altered
SQL> select index_name, status
2 from user_indexes
3 where index_name = 'I _ my_objects_move ';
Index_name status
--------------------------------------
I _my_objects_move
Valid
2 shrink lab
SQL> Create Table my_objects tablespace assm as select * From all_objects where rownum <20000;
Table created
SQL> Create index I _my_objects on my_objects (object_id );
Index created
SQL> Delete from my_objects where object_name like '% C % ';
7546 rows deleted
SQL> Delete from my_objects where object_name like '% u % ';
2959 rows deleted
SQL> commit;
Commit complete
SQL> ALTER TABLE my_objects enable row movement;
Table altered
SQL> ALTER TABLE my_objects shrink space;
Table altered
SQL> select index_name, status
2 from user_indexes
3 where index_name = 'I _ my_objects ';
Index_name status
--------------------------------------
I _my_objects
Valid
3 conclusion
When moving row data, shrink also maintains the rowid information of the corresponding row on the index. Of course, the cost of maintaining the index in the shrink process is also high. After the table is moved, the index status is unusable and requires rebuild.