LOB欄位資料清理 - 更新為null後move lob

tolywang發表於2014-06-19

Oracle 11.2.0.2  ,  AIX 6.1  

包含LOB SEGMENT的表lob欄位可以update為NULL , 更新後需要move LOB 釋放空間: 

update   applsys.fnd_lobs   set  file_data = null  where ....  ; 
alter table applsys.fnd_lobs enable row movement ;
alter table  applsys.fnd_lobs move lob(file_data) store as (TABLESPACE AOLBG);
 alter table applsys.fnd_lobs disable row movement ;

update   hwcust.HW_FND_LOBS_TI  set  file_data = null  where  .....  ;
alter table hwcust.HW_FND_LOBS_TI enable row movement ;
alter table hwcust.HW_FND_LOBS_TI move lob(file_data) store as (TABLESPACE AOLBG);
 alter table hwcust.HW_FND_LOBS_TI disable row movement ;

 
更新為null 後 lob欄位要求的空間比較小 , move 動作也非常快,300多萬的表,move 也需要50多秒 。 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-1188797/,如需轉載,請註明出處,否則將追究法律責任。

相關文章