Oracle Tablespace之间数据迁移

[size=large]分区表常用的数据字典

分区表信息: dba_part_tables
显示分区: dba_tab_partitions
显示子分区: dba_tab_subpartitions
显示分区列: dba_part_key_columns
显示子分区列:dba_subpart_dey_columns
显示分区索引:dba_part_indexes
显示索引分区:dba_ind_partitions [/size]



select 'alter table '||table_name||' move tablespace wzrq ;'
from user_all_tables where tablespace_name='GZNS'
UNION ALL
select 'alter table '||table_name||' move tablespace wzrq ;'
from dba_lobs where tablespace_name='GZNS'
union all
--分区表
select 'ALTER TABLE '|| table_name ||' MOVE PARTITION '||partition_name||' TABLESPACE WZRQ NOLOGGING; '
from dba_tab_partitions where 1=1
and tablespace_name='GZNS'
order by table_name ,partition_position


--分区索引
select 'alter index '||index_name|| ' rebuild tablespace wzrq;'
from user_indexes where index_type='NORMAL' and TABLESPACE_NAME='GZNS'
and dropped='NO'
union all
select 'alter index '||index_name|| ' rebuild tablespace wzrq;'
from user_indexes where index_type='NORMAL' and table_owner='WZRQ'
and dropped='NO'


转移CLOB字段

alter table KNOWLEDGEITEM move lob(KILOCALTEXT) store as (tablespace WZRQ);
alter table MAIL_JOB move lob(MAIL_CONTENT) store as (tablespace WZRQ);
alter table FAX_JOB move lob(FAX_CONTENT) store as (tablespace WZRQ);


参考资料
[url]http://blog.sina.com.cn/s/blog_713bf4fe01011cyu.html[/url]
[url]http://xsb.itpub.net/post/419/38506[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值