清理分區注意事項

1、檢查要處理表是否存在全局索引

select * from user_indexes t where table_name ='xxxxxxx' and t.PARTITIONED='NO'

2、若存在,以下兩種方法

(1)刪除分區或者truncate分區後要更新全局索引(此操作會產生排它鎖,導致表不可用,同時也會加重服務器負載)

alter table xxxxxxx drop partition p_2014_12 update global indexes;

(2)重建索引(此時的索引處於不可用狀態,對業務有一定影響)

alter index index_name rebulid online parallel 8;

3、若不存在,直接清理分區

alter table xxxxxxx drop partition p_2014_12;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章