EBS 清理附件表空间apps_ts_media表空间内附件fnd_lobs

第一步:
设置FND_LOBS附件的expiration_date( 此步的目的在于运行第二步的请求时,他只会删除FND_LOBS里面expiration_date已经过期了的,未过期或者为空的,他是不会删的,而我们这里大部分附件的expiration_date都为空,所以需要先将他们更新为一个过期的日期,这样请求就能把他们都清理掉。
第二步
在ebs内运行请求“ Purge Obsolete Generic File Manager Data
1. 添加请求,参考 216541.1
Assign the "Purge Obsolete Generic File Manager Data" Concurrent 
Program to the Request Group "System Administrator Reports". 

1. Access Oracle Applications as the Sysadmin user. 
2. Select the System Administrator responsibility. 
3. Navigate to the following menus:  
   Security / Responsibility / Request 
4. Place the cursor in the "Group" field of the 
   "Request Groups" form.
5. Select "View" from the menu.
   Select "Find" from the menu.
   Select "System Administrator Reports".
6. Place the cursor in the "Type" column.
   Use "File" from the menu to create a "New" record. 
7. Set the "Type" field to "Program".
8. Select "Purge Obsolete Generic File Manager Data" for the "Name" field.
9. Select "File" from the menu.
   Select "Save and Proceed" from the menu.
 
  
 
  

Program Parameters:

  1. Expired:  Enter "Y" if you want to purge expired data only. Enter "N" if you want the purge to include all data. The default is "Y."
  2. Program Name: Enter the program name(s) to process. Leave blank to process all programs.
  3. Program Tag: Enter the program tag(s) to process. Leave blank to process all program tags. Tags are identifiers used by the Generic File Manager for categorization purposes.
2. 运行请求
用管理员sysadmin本地登录ebs
运行后可以查看fnd_lobs表内那些行已经被删除,不过实际的物理大小还是没有变的
第三步:将数据文件清理
运行上面的请求后,实际的数据并不会变化,只是FND_LOBS内相关行被清理了,实际的附件还是存在数据库内。
此时可以通过move操作或者export/import操作将那些数据通过转移来清空释放。
move方法
首先move表 move完要重建索引
alter table APPLSYS.APPLSYS.FND_LOBS  move ;
alter index APPLSYS.FND_LOBS_CTX rebuild;
alter index APPLSYS.FND_LOBS_N1 rebuild;
alter index APPLSYS.FND_LOBS_U1 rebuild;
对应clob字段也就是file_data字段要单独move,在move的过程中会降低高水位线。
查看 file_data 的大小
select t.BYTES/(1024*1024) M,t.owner,t.segment_name,t.segment_type from dba_segments t where t.tablespace_name=upper('APPS_TS_MEDIA') and t.owner='APPLSYS';
找到lob段,根据大小创建一个临时表空间
create tablespace test_tmp  datafile '路径.dbf'  size 20g;
空间不够的话可以添加
alter tablespace test_tmp add datafile '路径.dbf' size 20g;
把表空间分配给applsys用户
alter user applsys quota unlimited on test_tmp;
移动lob段
alter table applsys.fnd_lobs move log(file_data)  store as (tablespace test_tmp);
完了后在移动回去
alter table applsys.fnd_lobs move log(file_data)  store as (tablespace APPS_TS_MEDIA);
最后删除表空间
drop tablespace test_tmp
在操作系统里面删除表空间文件
rm  test_tmp.dbf;
在查看apps_ts_media 表空间发现使用率已经下降、

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值