当前位置:网站首页>Configuring the environment for RMAN backups_ Configure backup retention policy

Configuring the environment for RMAN backups_ Configure backup retention policy

2022-06-09 08:42:00 Count words and lines

Backup retention policies specify which backups must be retained to meet data recovery requirements .

Policies can be based on recovery windows or redundancy . Use CONFIGURE RETENTION POLICY Command to specify the retention policy .


1. Configure redundancy based retention policies

command CONFIGURE RETENTION POLICY Parameters of REDUNDANCY Appoint RMAN How many copies of each data file and control file are saved Full or level 0 Backup of . The default retention policy is REDUNDANCY 1.

If a particular data file or control file is full or level 0 The number of backups of exceeds the set REDUNDANCY value , that RMAN Treat additional backups as obsolete . When more backups are produced ,RMAN Keep track of which is reserved , Which is out of date .RMAN Retain all required archive logs and incremental backups to restore up-to-date backups .

Suppose on Monday , Tuesday , Wednesday and Thursday for data files 7 All have been fully backed up . We have it now 4 Data files 7 Full backup of . If REDUNDANCY yes 2, So Monday and Tuesday backups are obsolete . If you make another backup on Friday , So the data file 7 Backups made on Wednesdays have become obsolete .

Suppose in another case ,REDUNDANCY yes 1. Run levels at noon on Monday 0 Database backup of , Run levels at noon on Tuesday and Wednesday 1 Incremental backup of , Run levels at noon on Thursday 0 Backup of . Run the command immediately after the daily backup DELETE OBSOLETE. On Wednesday DELETE The command does not remove Tuesday's level 1, Because this backup is not redundant : Tuesday's level 1 The backup of can be used to restore the level of Monday 0 Between Tuesday noon and Wednesday noon . However , Run on Thursday DELETE The command removes the previous level 0 And level 1 Backup of .

stay RMAN Prompt to run CONFIGURE RETENTION POLICY command , As shown below :
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;


2. Configure the retention policy based on the recovery window

command CONFIGURE Parameters of RECOVERY WINDOW Specify the number of days between the current time and the oldest recovery point .

RMAN No full backups or levels during the recovery window will be 0 Incremental backups of are considered expired . Besides ,RMAN Keep all required archive logs and levels 1 Incremental backup to restore a random point in the window period . stay RMAN Prompt CONFIGURE RETENTION POLICY Command to configure the retention policy based on the recovery window .

The following example ensures that the database can be restored to any point in the previous week :
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

RMAN Backups that are defined as expired by the recovery window will not be automatically deleted , But in REPORT OBSOLETE Output They are shown as OBSOLETE And in View V$BACKUP_FILES Show them in the OBSOLETE In the column . If you run DELETE OBSOLETE command ,RMAN Delete expired files .


3. Disable retention policy

When the retention policy is disabled ,RMAN No backups will be considered expired .

Run the following command to disable the retention policy :
CONFIGURE RETENTION POLICY TO NONE;

Configure the retention policy as NONE Different from clear configuration . Clear will revert to the default settings REDUNDANCY 1, and NONE Yes disable it .

If the retention policy is disabled , function REPORT OBSOLETE or DELETE OBSOLETE Command without transferring retention policy options to the command , that RMAN Report errors , Because there is no retention policy that can be used to determine which backups are expired .

Be careful : If you are using a quick recovery zone , Then do not disable the retention policy to run the database . If a file is never considered expired , Then files can only be deleted from the fast recovery area after being backed up to other disk locations or third-party storage devices such as tapes . This behavior may run out of space in the recovery area , Prevent the normal operation of the database .



source :《Oracle Database Backup and Recovery User’s Guide,19c》

原网站

版权声明
本文为[Count words and lines]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090820550214.html