1、修改分区表的默认表空间:
select 'alter table '||table_name||' modify default attributes tablespace TSDAT01' from dba_tables where table_name in ('T');
查询出的语句直接执行
2、移动现有分区到其他表空间
begin
for x in(select TABLE_OWNER,table_name,partition_name from dba_tab_partitions where table_name in ('T'))
loop
execute immediate 'alter table '||x.table_owner||'.'||x.table_name||' move partition ' || x.partition_name || ' tablespace users';
end loop;
end;
/
select 'alter table '||table_name||' modify default attributes tablespace TSDAT01' from dba_tables where table_name in ('T');
查询出的语句直接执行
2、移动现有分区到其他表空间
begin
for x in(select TABLE_OWNER,table_name,partition_name from dba_tab_partitions where table_name in ('T'))
loop
execute immediate 'alter table '||x.table_owner||'.'||x.table_name||' move partition ' || x.partition_name || ' tablespace users';
end loop;
end;
/