首页 » ORACLE » CONTROL_FILE_RECORD_KEEP_TIME and retention policy

CONTROL_FILE_RECORD_KEEP_TIME and retention policy

这 两天为了这两个参数都搞晕了,CONTROL_FILE_RECORD_KEEP_TIME 控制文件记录保留天数,retention policy ,rman 的备份保留策略,下面记录一下收集的

When you do not use a recovery catalog, the control file is the sole source of information about RMAN backups. As you make backups, Oracle records these 

backups in the control file. To prevent the control file from growing without bound to hold RMAN repository data, records can be reused if they are older 

than a threshhold you specify.

The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter determines the minimum age in days of a record before it can be overwritten

determines how long information that can be used by RMAN is kept in the control file.
The default value for this parameter is 7 days and can be as many as 365 days. The greater the
number, the larger the control file becomes to store more information

When Oracle needs to add new RMAN repository records to the control file, but no record is older than the threshhold, Oracle attempts to expand the size of 

the control file. If the underlying operating system prevents the expansion of the control file (due to a disk full condition, for instance), Oracle 

overwrites the oldest record in the control file and logs this action in the alert log.

The default value of CONTROL_FILE_RECORD_KEEP_TIME is 7 days. If you are not using a recovery catalog, then set the CONTROL_FILE_RECORD_KEEP_TIME value to 

slightly longer than the oldest file that you need to keep.

When a control file record containing information about a file created in the flash recovery area is about to be reused (because the record is older than 

CONTROL_FILE_RECORD_KEEP_TIME), if the file is eligible for deletion then the database attempts to delete the file from the flash recovery area.

This means that the control file cannot hold a record of all flash recovery area files needed to satisfy the configured retention policy.

Make more files in the flash recovery area eligible for deletion, by changing the retention policy to a shorter recovery window or lower degree of 

redundancy.

The RECOVERY WINDOW parameter of the CONFIGURE command specifies the number of days between the current time and the earliest point of recoverability. RMAN 

does not consider any full or level 0 incremental backup as obsolete if it falls within the recovery window. Additionally, RMAN retains all archived logs and 

level 1 incremental backups that are needed to recover to a random point within the window.

RMAN does not automatically delete backups rendered obsolete by the recovery window. Instead, RMAN shows them as OBSOLETE in the REPORT OBSOLETE output and 

in the OBSOLETE column of V$BACKUP_FILES. RMAN deletes obsolete files if you run the DELETE OBSOLETE command.

When you disable the retention policy, RMAN does not consider any backup as obsolete.

To disable the retention policy, run this command:

CONFIGURE RETENTION POLICY TO NONE;

Configuring the retention policy to NONE is not the same as clearing it. Clearing it returns it to its default setting of REDUNDANCY=1, whereas NONE disables 

it completely.

If you are using a flash recovery area, then you should not run your database with the retention policy disabled

The REDUNDANCY parameter of the CONFIGURE RETENTION POLICY command specifies how many backups of each datafile and control file that RMAN should keep. In 

other words, if the number of backups for a specific datafile or control file exceeds the REDUNDANCY setting, then RMAN considers the extra backups as 

obsolete. The default retention policy is REDUNDANCY=1.

nothing obsolete it means control_file_record_keep_time will not affect backups unless it will be less then or equal to retention policy REDUNDANCY-base.

Besides affecting datafile and control file backups, the retention policy affects archived logs and archived log backups. 
First, RMAN decides which datafile and control file backups are obsolete. Then, RMAN considers as obsolete all archived 
log backups that are older than the oldest datafile or control file backup that must be retained."

上面一篇看着有点懵也或者豁然开朗,CONTROL_FILE_RECORD_KEEP_TIME就是控制controlfile的保留多少天的记录,防止controlfile无限扩大,最大值是365天,retention policy 是rman的保留策略控制备份集的有效时间,过期为obsolete状态并不会自动删除,建议CONTROL_FILE_RECORD_KEEP_TIME大于等于retention policy window 天数

我测试了一下,如果archivelog mode,归档日志默认都存在已有3个多月,CONTROL_FILE_RECORD_KEEP_TIME=7,CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;report obsolete根本不会影响归档日志,只会显示obsolete backupset ,list archivelog all也只显示7天的archivelog ,所以7天前archivelog file需要从os 删除,如果此时再用backup database plus archivelog delete input; 那只会备份数据库且最近7天的所有归档日志并删除,但CONFIGURE RETENTION POLICY TO REDUNDANCY则有区别!

打赏

目前这篇文章有20条评论(Rss)评论关闭。

  1. Victor Wasowski | #1
    2011-12-21 at 05:03

    I truly enjoy looking through on this website , it has got superb articles .

  2. 氙气灯 | #2
    2011-09-05 at 14:57

    版主,看的还不是很明白,希望能再详细一下,真的谢谢了。我是你的站点粉丝哦,每天必来的。I love you!

  3. 手板模型 | #3
    2011-09-05 at 12:21

    版主又发布新文章,据说实用性挺高,感觉版主好有思想。
    版主辛苦了,支持。

  4. 宁波网络公司 | #4
    2011-09-05 at 11:30

    好好学习,确实要科学分析才能真正了解这个东西的,收藏一下。谢谢版主。

  5. 佐敦油漆 | #5
    2011-09-05 at 10:09

    最近逛了一些博客,很多都很有创意,不过也有些看来看去好多都是相互转载的文章,没有多少是原创的,看多了也眼睛疲劳了,但是版主你这个博客还可以,终于有点新鲜感,所以忍不住留言了,当然也算是灌水感谢一下。版主加油!支持你!