how to move indexes to another tablespace
select owner, index_name, TABLE_NAME, a.TABLESPACE_NAME
from all_indexes a where a.TABLE_NAME = 'REFUND';
ALTER INDEX CBS.PK_REFUND_ID REBUILD TABLESPACE T_IDX;
ORA-14086: A partitioned index may not be rebuilt as a whole.
I can't execute this statement because I don't know in which partition the index is
ALTER INDEX PK_REFUND_ID REBUILD PARTITION xxxxxx TABLESPACE T_IDX;
Because you also need partition name info which can be reached from
user[all/dba]_tab_partitions
dictionary view. If you got the related partition name, thenmight be used just to rebuild the index.
or
might be used to move the index of the partition to a different tablespace. Using
ONLINE
option would suit well for the tables currently having DML activity.Use the following code in order to run as a batch job