move
move表的时候,索引会失效,索引需要重建
alter table table_name move talbespace tablespace_name
索引移到另外一个表空间
alter index index_name rebuild (重建索引)
alter index index_name rebuild tablespace tablespace_name;
如果是单级分区,则使用关键字partition,如果是多级分区,则使用subpartition替代partition。如果分区或分区索引比较大,可以使
用并行move或rebuild,parallel(degree 2)。
select 'alter table '||owner||'.'||segment_name||' move partition ' ||partition_name||' tablespace HWM; ',bytes
from dba_segments where segment_name = 'F_DISTRIBUTION'and segment_type = 'TABLE PARTITION'
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P00 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P01 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P02 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P03 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P04 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P05 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P06 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P07 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P08 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P09 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P10 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P11 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P12 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_P13 tablespace HWM;
alter table DW.F_DISTRIBUTION move partition F_DISTRIBUTION_PMAX tablespace HWM;
重建全局索引
Alter index global_index rebuild;
IMP/EXP 段的碎片整理
、下面脚本可用来检测碎片比例,FSFI 的最大可能值为100(一个理想的单文件表空间)。
select tablespace_name,sqrt(max(blocks)/sum(blocks))*(100/sqrt(sqrt(count(blocks)))) FSFI
from dba_free_space
group by tablespace_name order by 1;
spool fsfi.rep;
/
统计出了数据库的 FSFI 值,就可以把它作为一个可比参数。在一个有着足够有效自由空间,且 FSFI 值超过 30 的表空间中,
很少会遇见有效自由空间的问题。当一个空间将要接近可比参数时,就需要做碎片整理了。
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22934571/viewspace-1045112/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22934571/viewspace-1045112/