2012年8月13日月曜日

[基础知识] 对表进行碎片整理

1. move
表移动后相关索引和统计信息会失效, 需要重创建或收集

1-1. 普通 heap 表
# 生成新数据段, 块内数据重新配置, data_object_id 会发生改变
alter table t move [ pctfree | pctused | initrans ] [tablespace ts_name];

1-2. 索引组织表 (IOT)
alter table t move online;

1-3. 分区表
1-3-1. 分区单位的移动
alter table t move partition t_partition;

1-3-2. 子分区单位的移动
# 存在子分区时, 3-1 的分区移动会报 ORA-14257 错误
alter table t move subpartition t_subpartition;

0 件のコメント:

コメントを投稿