ITPub博客

首页 > 数据库 > Oracle > LOB字段数据清理 - 更新为null后move lob

LOB字段数据清理 - 更新为null后move lob

原创 Oracle 作者:tolywang 时间:2014-06-19 10:16:06 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/35489/viewspace-1188797/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    14695716