全备后 归档日志就自动被标记为可删除,除非对归档日志设置备份策略

Applies To

All Users
Oracle Database - Enterprise Edition - Version 19.3.0.0.0 and later

Summary

++ FRA is configured and log_archive_dest_1 is set to write to FRA:

log_archive_dest_1 = "LOCATION=USE_DB_RECOVERY_FILE_DEST"

db_recovery_file_dest = "+DATA"

db_recovery_file_dest_size= 1200G

++ Retention policy is set to default i.e. REDUNDANCY 1. Also ARCHIVELOG DELETION POLICY is default i.e. NONE:

CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

++ Database backup is performed. Archives were NOT backed up. Still, it was noticed that FRA space reclamation automatically deleted an archive which was not backed up:

2025-02-28T13:54:20.074043-05:00
Deleted Oracle managed file +DATA/DBNAME/ARCHIVELOG/2025_02_27/thread_1_seq_3637.1228.1194173187

In above excerpt, archive sequence# 3637 was not backed up by RMAN yet it was deleted by FRA space reclamation mechanism.

Solution

++ Retention policy of redundancy 1 means that rman needs to keep only the LATEST level 0 / full backup of the database.

++ Any archive logs older then the LATEST level 0 / full backup will be marked reclaimable even if they were never backed up.

++ This is expected behavior and can be easily verified via testcase:

1. Before Backup:

Space reclaimable is 0

SQL> select * from V$RECOVERY_AREA_USAGE;

FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES CON_ID

----------------------- ------------------ ------------------------- --------------- ----------

ARCHIVED LOG 55.75 0 65 0

x$kccagf.RECTYPE is not populated which means the archive is not reclaimable:

SQL> select DEST_ID, THREAD#, SEQUENCE#, to_char(COMPLETION_TIME, 'DD-MON-YYYY HH24:MI'), STATUS, BACKUP_COUNT, RECTYPE, FLAGS from v$archived_log al, x$kccagf dl where al.RECID = dl.RECID(+) and al.DEST_ID=1 and al.COMPLETION_TIME > SYSDATE-5;

DEST_ID THREAD# SEQUENCE# TO_CHAR(COMPLETION_TIME,'D S BACKUP_COUNT RECTYPE FLAGS

---------- ---------- ---------- -------------------------- - ------------ ---------- ----------

1 1 863 15-MAR-2025 01:19 A 0

1 1 862 13-MAR-2025 22:00 A 0

1 1 864 16-MAR-2025 06:00 A 0

2. Perform a Level 0 / Full backup:

RMAN> backup as compressed backupset database format '/u01/app/oracle/oradata/bkp/%d_%U';

3. After backup:

Old archives (older then the latest full backup) are now marked reclaimable:

SQL> select * from V$RECOVERY_AREA_USAGE;

FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES CON_ID

----------------------- ------------------ ------------------------- --------------- ----------

ARCHIVED LOG 55.75 55.75 65 0

x$kccagf.RECTYPE = 11 i.e. reclaimable

SQL> select DEST_ID, THREAD#, SEQUENCE#, to_char(COMPLETION_TIME, 'DD-MON-YYYY HH24:MI'), STATUS, BACKUP_COUNT, RECTYPE, FLAGS from v$archived_log al, x$kccagf dl where al.RECID = dl.RECID(+) and al.DEST_ID=1 and al.COMPLETION_TIME > SYSDATE-5;

DEST_ID THREAD# SEQUENCE# TO_CHAR(COMPLETION_TIME,'D S BACKUP_COUNT RECTYPE FLAGS

---------- ---------- ---------- -------------------------- - ------------ ---------- ----------

1 1 864 16-MAR-2025 06:00 A 0 11 0

1 1 863 15-MAR-2025 01:19 A 0 11 0

1 1 862 13-MAR-2025 22:00 A 0 11 0

++ As we can see in above test, even though the archives themselves do not have backup, they are marked reclaimable because they are older then the full backup created. In case of space pressure, they will be deleted.

++ To avoid FRA from deleting any archivelog without backup, you need to set the archive deletion policy like below:

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DEVICE TYPE DISK;

References

MOS document id: 3080338.1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值