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)评论关闭。