You may need to move some objects to another tablespace or you may need to move all objects to one new tablespace under schema
I will share some sql statement to achieve this purpose. Here is the steps:
To move the tables in the schema;
select 'alter table '||owner||'.'||table_name||' move tablespace NEW_TS nologging parallel 16;' from dba_tables where owner='XXX' and tablespace_name='OLD_TS'; To move table partitions in the schema; select 'ALTER TABLE '||table_owner||'.'||table_name||' MOVE PARTITION '||partition_name||' TABLESPACE NEW_TS NOLOGGING parallel 16;' from dba_tab_partitions where table_owner='XXXX'; To move lobs in the schema; select 'alter table '||owner||'.'||table_name||' move lob ('||column_name||') store as (tablespace NEW_TS);' from dba_lobs where tablespace_name<>'NEW_TS' and owner='XXXX'; To move indexes in the schema; select 'alter index '||owner||'.'||index_name||' rebuild nologging parallel tablespace NEW_TS;' from dba_indexes where tablespace_name<>'NEW_TS' and owner='XXXX'; To move index partitions in the schema; select 'alter index '||index_owner||'.'||index_name||' rebuild partition '||partition_name||' nologging parallel 16;' from dba_ind_partitions where tablespace_name<>'NEW_TS' and index_owner='XXXX'
If there are unusable indexes after move operation, recompile commands can be generated as follows.
select 'alter index '||owner||'.'||index_name||' rebuild nologging parallel tablespace NEW_TS;' from dba_indexes where status='UNUSABLE';
PS: after move object you need to set Indexes as Noparallel!
select 'alter index '||owner||'.'||index_name||' noparallel;' from dba_indexes where degree>1;