現象
…
2235_g28w3d16_.bkp tag=TAG20181227T142235 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/27/2018 14:25:46
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 52428800 bytes disk space from 4294967296 limit
基本原因
db_recovery_file_dest有size 2G限制,如果用戶沒有設置過,應該是歸檔的文件超過了這個大小,導致歸檔失敗了。
查看:
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/archive_log
Oldest online log sequence 255
Next log sequence to archive 257
Current log sequence 257
SQL> show parameter db_recovery_file_dest_size
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest_size big integer 2G
解決方法
刪除多餘歸檔,然後是指定大的db_recovery_file_dest_size
找出無效的expired的歸檔日誌
RMAN> crosscheck archivelog all;
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1619 devtype=DISK
validation succeeded for archived log
archive log filename=/u01/app/oracle/archive_log/1_254_974460126.dbf recid=98 stamp=995973231
validation succeeded for archived log
archive log filename=/u01/app/oracle/archive_log/1_255_974460126.dbf recid=99 stamp=995973433
validation succeeded for archived log
archive log filename=/u01/app/oracle/archive_log/archive_1_256_974460126.log recid=100 stamp=995973902
Crosschecked 3 objects
直接全部刪除過期的日誌
RMAN> delete expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1619 devtype=DISK
specification does not match any archive log in the recovery catalog
也可以直接用一個指定的日期來刪除
RMAN> delete noprompt archivelog until time "sysdate -3";
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1619 devtype=DISK
specification does not match any archive log in the recovery catalog
指定retention的策略,使archivelog不至於這樣增加
7天外的備標記爲expired
RMAN> configure retention policy to recovery window of 7 days;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters are successfully stored
RMAN> configure retention policy to redundancy 3;
using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
new RMAN configuration parameters are successfully stored
更改限制
SQL> alter system set db_recovery_file_dest_size=4G scope=both;
System altered.
也可以更改到沒有限制的地方
SQL> alter system set log_archive_dest='/home/oracle';