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 表空間發現使用率已經下降、

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