您的位置:首页 > 其它

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

2016-12-22 11:48 441 查看
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;

/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: