表包含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!='PACSLOB';
针对表:
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';
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。