当前位置:网站首页>RMAN backup concept_ About backup retention policy
RMAN backup concept_ About backup retention policy
2022-06-09 08:43:00 【Count words and lines】
have access to CONFIGURE RETENTION POLICY Command to create a continuous and automatic backup retention policy .
When the backup retention policy takes effect ,RMAN according to CONFIGURE The criteria specified by the command treat a backup of a data file or control file as an expired backup , in other words , Backups that are no longer needed for recovery . have access to REPORT OBSOLETE Command to view expired files and DELETE OBSOLETE Command to delete them .
When backups are generated over time , Old backups will become out of date , Because they are no longer needed to meet retention policies .RMAN Can identify expired files , But it doesn't automatically delete them . You have to use DELETE OBSOLETE Command to delete files that are no longer required to meet the retention policy .
If a quick recovery zone is configured , So when you need to prepare more recovery area space for new files , The database automatically deletes expired files or files that have been backed up to tape . Disk quota rules are different from retention policy rules , But the database will not violate the retention policy to delete files to meet the disk quota .
REPORT OBSOLETE or DELETE OBSOLETE Based on user-defined retention policies , That is, it does not need to be used for recovery to determine that the backup is expired . Only when RMAN When a cross check is performed and a file cannot be found , The backup is considered invalid (expired) Backup . In short , Be overdue (obsolete) Means that the file does not need , And it doesn't work (expired) Means it can't be found .
Backup retention policies only apply to full or level 0 Data file and control file backup . For data file copy and proxy copy , If RMAN Decide that a copy or proxy copy does not need , Then the copy or proxy copy can be deleted . For backup sets of data files ,RMAN You cannot delete a backup set until all data file backups in the backup set have expired .
Retention policies are not responsible for deleting or archiving redo Logs and levels 1 Incremental backup of is out of date . It is , When no full backup exists that requires them , These files become out of date . In addition to affecting the full or level 0 Data file and control file backup , Backup retention policies also affect archiving redo Logs and levels 1 Incremental backup of . First ,RMAN Decide which data and control file backups are out of date . then ,RMAN Archive logs and levels that are not needed to restore the oldest data files or control files that must be retained 1 Incremental backups of are considered expired .
notes : If the backup is not RMAN Technology deletion for ,RMAN Cannot execute automatic retention policy , for example , Tape retention policy via media manager . The media manager must never fail a tape until all... On the tape RMAN Backup directories that have been removed from the media manager (catalog) Delete in .
There are two mutually exclusive options when implementing a retention policy : Redundancy and recovery windows .
1. About the recovery window
The recovery window is a period of time that starts at the current time and extends back to the recoverable point . A recoverable point is a hypothetical point in time recovery (TIPR) The earliest time , This is the earliest point in time that a media failure can be recovered .
for example , If the execute recovery window is 1 Zhou , that RMAN Keep full backups and required incremental backups and archive logs , In this way, the database can be restored to the past 7 Days. . Implement the following retention policies :
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
This command ensures that for each data file , A backup that is older than the recoverable point in time is retained . for example , If the recovery window is 7, Then each data file must always have a backup that meets the following conditions :
SYSDATE - BACKUP CHECKPOINT TIME >= 7
All older backups than the most recent one that meets this condition are expired .
Suppose the retention policy is as shown in the following figure :

Retention policies have the following aspects :
1) The recovery window is 7 God .
2) Database backup is scheduled every two weeks , On these dates :1 month 1 Japan ,1 month 15 Japan ,1 month 29 Japan ,2 month 12 Japan .
3) The database runs on ARCHIVELOG Pattern , If the retention policy requires , Archive logs are saved only on disk .
Such as Figure 8-4 Shown , The current time is 1 month 23 Japan , The recoverable time point is 1 month 16 Japan . therefore ,1 month 15 Daily backup needs to be used for recovery , from log Sequence 500 To 850 The same is true of archive logs for . stay 500 Previous logs and 1 month 1 The backup of day is expired , Because they do not need to be used to recover to the point in time within the window .
Suppose the same scenario lasts for a week , As shown in the figure below :
In this scenario , The current time is 1 month 30 Japan , The recoverable time point is 1 month 23 Japan . Be careful 1 month 15 How can a backup of a day not expire even if it is a more recent backup (1 month 29 Japan ) Exists during the recovery window . This happens because the restore 1 month 29 Day backups do not allow you to recover to the earliest time in the window ,1 month 23 Japan . To ensure recoverability at any point in time during the window , Must keep 1 month 15 Day backup and slave sequence 500 To 1150 All archived logs for .
2. About backup redundancy
In some cases , Using recovery windows complicates disk space planning , Because the number of backups that must be retained is not constant , Depends on the backup schedule . contrary , The redundancy based retention policy specifies how many backups must be retained for each data file .
for example , Redundancy can be configured as 2, as follows :
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
The default retention policy configuration is REDUNDANCY 1.
3. About batch deleting expired backups
Can run REPORT OBSOLETE The command determines which backups are currently expired based on the retention policy .
A pair of commands ,DELETE OBSOLETE Delete all files that are expired according to the retention policy . It can run on a regular basis DELETE OBSOLETE Command to minimize the waste of space for storing expired backups . for example , Can be run in weekly scripts DELETE OBOSOLETE.
It can also be done through REPORT or DELETE The order specifies REDUNDANCY or RECOVERY WINDOW Option to override the configured retention policy . Use DELETE OBSOLETE And the Restore window option, which is shorter than the configured Restore window, actually reduces the number of recoverable windows . for example , If the configured window is 14 God , But you do DELETE OBSOLETE RECOVERY WINDOW OF 7 DAYS, Then you no longer have the ability to recover to 7 Days and 14 Time point between days ago .
4. About backup retention policies and quick recovery zone deletion rules
If a quick recovery zone is configured , Then the database uses an internal algorithm to select files that are no longer needed in the fast recovery area to meet the configured retention policy .
When deciding which files to delete from the quick recovery area to meet the disk quota plan , Retention policies will never be violated . These states are OBSOLETE To meet the disk quota rules .
RMAN The state of OBSOLETE It is always determined by the retention policy . for example , If the database is backed up in RMAN In the warehouse is regarded as OBSOLETE, Then it is because it does not need to be used to recover to the point in time within the recovery window, or it is redundant .
In the fast recovery area OBSOLETE There is an important difference between the rule of status and the rule of disk quota meeting the deletion condition . Suppose the archive log is on disk , Required by the current recovery window , So it's not expired . If you back up these logs to tape , Then the retention policy regards these disk logs as necessary , That is, those that have not expired . However , The fast recovery area disk quota algorithm considers the logs on the disk as eligible for deletion , Because they have been backed up to tape . The logs on the disk are RMAN The status in the warehouse is not OBSOLETE, However, they meet the deletion conditions of the quick recovery area .
Refer to the following sections for more information on how to configure backup retention policies :
RMAN Configure backup retention policy (RETENTION POLICY)
source :《Oracle Database Backup and Recovery User’s Guide,19c》
边栏推荐
- 2022-2028 global nonlinear node detector industry survey and trend analysis report
- Huayun data was selected as the representative manufacturer of cloud infrastructure in IDC development trends of industrial software and industrial Internet
- Sql: actors and directors who have cooperated at least three times
- Mobile terminal layout of Xiaomi official website
- Nodejs使用Net模块创建TCP服务器和客户端
- 安科瑞配电室综合监控系统实现配电室内环境的在线监测,保障配电室设备的安全运行
- 编辑器说明-备用
- RMAN备份概念_关于RMAN备份的多个拷贝
- 使用闪回数据库(FLASHBACK DATABASE)和还原点(RESTORE POINT)
- 2022年5月29日16:05:09
猜你喜欢

Nodejs使用Net模块创建TCP服务器和客户端

Creation of JS class and use of constructor constructor

English语法_副词

如何查看手机绑定过的网站或者APP:注销手机号之前你必须要做的——换绑所有旧手机号绑定过的网站或者APP

安科瑞配电室综合监控系统实现配电室内环境的在线监测,保障配电室设备的安全运行

js类的创建和constructor的构造函数的使用

Direct application of 10 kinds of question type explosive text title sentence patterns

【matlab】【数模】【1】linprog求解线性规划,标准型

Self made compiler learning 1: use of CB compiler

Modify PE program entry point
随机推荐
EDA open source simulation tool verilator getting started 1: installation and testing
2022-2028 global LED ribbon industry research and trend analysis report
系统运维系列 之greenplum vacuum清理删除数据命令
Configuring the environment for RMAN backups_ Configure backup retention policy
2022年5月29日16:05:09
SSM implements selected deletion
RMAN备份概念_在线备份和备份模式
extends和super的使用
办公软件系列 之excel应用4
How to solve the problem of mouseup event invalidation
SQL: 超过经理收入的员工
Hj22 water bottle
Sql: actors and directors who have cooperated at least three times
Sql: Sales Analysis III
修改市場活動錶
May 29, 2022 16:05:09
About Matrix Decompositions
How to view websites or apps bound to mobile phones: what you must do before you log off your mobile phone number - change and bind all websites or apps bound to your old mobile phone number
Self made compiler learning 3: introduction to flex and bison
Summary of string inversion methods