分区表更改默认表空间及移动现有分区到指定表空间

来源:互联网 发布:淘宝店怎么提升销量 编辑:程序博客网 时间:2024/05/01 20:25
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;
/
0 0
原创粉丝点击