Skip to content

RMAN Backup Records are Lost Regularly

I found something unusual about RMAN backup records.

1. Obsolete Not Deleted

Some backup files older than 3 months are definitely obsolete according to redundancy policy, but running daily commands including DELETE OBSOLETE does not remove them.

2. Backup Records Lost

Some old backup records are lost. It seems that control file regularly disconnect the relationship with those old backup records. Therefore, RMAN has no way to find obsolete files to delete.

3. Backup Records have no Content

Some old backup records contain no content. Although control file still keep those backup records, but it does not remember their content.

Let's see an aged backupset for instance. First, we crosscheck the backupset.

RMAN> crosscheck backupset 1990;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1334 instance=NBSCDB11 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/2l0pdp4q_2133_1_1 RECID=1990 STAMP=1100407962
Crosschecked 1 objects

It looks good, so next, we list its content.

RMAN> list backupset 1990;

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
1990    Incr 0  1.14M      DISK        00:00:00     2022-03-27 04:52:42
        BP Key: 1990   Status: AVAILABLE  Compressed: YES  Tag: TAG20220327T001514
        Piece Name: /backup/2l0pdp4q_2133_1_1

There's nothing in this backupset. Something is wrong.

Backup Record Keep Size

Let's see current size of backup records.

Backup Set

SQL> select records_used, records_total from v$controlfile_record_section where type='BACKUP SET';

RECORDS_USED RECORDS_TOTAL
------------ -------------
        1022          1022

This shows us that we can only keep at most 1022 backup sets currently.

Backup Piece

SQL> select records_used, records_total from v$controlfile_record_section where type='BACKUP PIECE';

RECORDS_USED RECORDS_TOTAL
------------ -------------
        1030          1030

This shows us that we can only keep at most 1030 backup pieces currently.

Solution

Such loss of memory in RMAN reminds me a parameter CONTROL_FILE_RECORD_KEEP_TIME which specifies the minimum number of days before a record in the control file can be reused in a circular fashion.

To keep more backup records than the current size, we should increase it, luckily, it's a dynamic parameter.

Check CONTROL_FILE_RECORD_KEEP_TIME

SQL> show parameter control_file_record_keep_time

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7

OK, it's 7 days.

Increase CONTROL_FILE_RECORD_KEEP_TIME

Here we raise the value from 7 into 21.

SQL> alter system set control_file_record_keep_time=21;

System altered.

The default scope is BOTH in all instances.

Check Current CONTROL_FILE_RECORD_KEEP_TIME

SQL> show parameter control_file_record_keep_time

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     21

Now we can keep more backup records.

Leave a Reply

Your email address will not be published.