表包含lob字段,需要收回空间,首先move表,move表,move完表后lob的空间并不会释放,还需要针对lob字段进行move:
非分区表lob的move:
alter table T_SEND_LOG move lob(MESSAGE) store as (tablespace DATALOB);
分区表lob的move:
alter table T_SEND_LOG move partition p2018 lob(MESSAGE) store as (tablespace DATALOB);
分区表move:
alter table T_SEND_LOG move partition p2018;
move表后记得rebuild索引。
批量生成语句参考:
针对表空间:
select ‘alter table ‘||a.owner||’.’||a.table_name||’ move lob(‘||a.COLUMN_NAME||’) store as (tablespace DATALOB);’
from dba_lobs a,DBA_SEGMENTS b where a.owner in (‘APP’)
and a.OWNER=b.OWNER and a.SEGMENT_NAME=b.SEGMENT_NAME and b.TABLESPACE_NAME!=’PAC免费云主机域名SLOB’;
针对表:
select ‘alter table ‘||a.owner||’.’||a.table_name||’ move lob(‘||a.COLUMN_NAME||’) store as (tablespace DATALOB);’
from dba_lobs a,DBA_SEGMENTS b where a.owner in (‘APP’)
and a.OWNER=b.OWNER and a.SEGMENT_NAME=b.SEGMENT_NAME and a.TABLE_NAME = ‘T_SEND_LOG’;
相关推荐: Oracle 10g 安装ASM (RHEL5)
1、在系统上安装ORACLEASM需要的包查看系统版本uname -r当前环境是2.6.18-164.el5下载相应的包进行安装http://www.oracle.com/technetwork/server-storage/linux/downloads/r…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。