各类user_segment移动表空间(table、lob、index)

本文介绍如何在Oracle数据库中进行表及索引的空间迁移,包括无LOB字段和含有LOB字段的表迁移方法,以及正常索引和LOB索引的重建过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

--table 无lob字段

alter table 表名 move tablespace 表空间名

 

--table 有lob字段

alter table 表名 move tablespace 表空间名 lob(lob字段名1,lob字段名2) store as (tablespace 表空间名);

 

--normal index

alter index index_name rebuild tablespace 表空间名;

 

--lob index

随lob字段自动建立,自动同lob字段的表空间保持一致,不需手动移动

 

select 'alter table ' || t.TABLE_NAME || ' move tablespace xxxx;' from user_tables t;

alter table t_lob move tablespace xxxx lob(lob_content) store as (tablespace xxxx);

select 'alter index '|| t.segment_name ||' rebuild tablespace xxxx;' from user_segments t where t.segment_type = 'INDEX'

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值