Oracle/RMAN: Delete noprompt obsolete 沒有清除過期的檔案

下午到某科技大學查看 RMAN backup 使用的空間愈來愈大原因.
因為在 cron table  中的 RMAN backup script 中有加了 Delete noprompt obsolete , 理論上應該在備份完 level 0 的 backup set 後, 會自動清除過期的 backup set 才對, 可是因為某種原因在某個日期以前的  backup set 就一直沒有清除

環境 OS : AIX 5.3, Oracle 9.2, RMAN 備份不使用 catalog DB
Cron table :
30 3 * * 0  /oracle/scripts/rmanbk_lv0     > /dev/null
30 3 * * 1,3,5  /oracle/scripts/rmanbk_lv1 > /dev/null
30 3 * * 2,4,6  /oracle/scripts/rmanbk_lv2 > /dev/null

步驟:
Check RMAN backup script , 沒什麼異常

RMAN> run{
2> backup
3> incremental level 0 database
4> filesperset=3
5> format '/oracle/archive/rmanbk/lv0_%t_%s_%p';
6> sql "alter system archive log current";
7> backup archivelog all;
8> delete noprompt obsolete ;
9> }


Check RMAN configuration, 注意 RETENTION POLICY 設成  REDUNDANCY 1

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default


實際執行一次 level 0 backup, 確定有把過期的  backup set 刪除

檢查每日的備份記錄, 發現某幾次的備份失敗, 而剛好這幾次備份前一週的 backup set 都沒被清除

RMAN-03002: failure of backup command at 11/21/2010 03:35:03
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /oracle/archive/unip_arch/1_252.arc
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory

答案就出來了, 因為 DB initialization parameter file 的 control_file_record_keep_time, 設的太低, 導致一次備份失敗後, control file 中就沒有之前 RMAN 的備份 meta data, 因而不知要刪除哪些檔案

後來 User 將 RETENTION POLICY 設成  REDUNDANCY 2 也讓事情更加惡化

PS. control_file_record_keep_time = REDUNDANCY (n) * Level 0 backup cycle (days)

留言

這個網誌中的熱門文章

12c RAC, OS log 出現 WARNING: couldn't allocate FBT table for module oracleacfs

新建的 12.2.0.1 資料庫 alert 出現 ORA-12012

11g client 連上 12c server, 出現 ora-28040