当前位置:网站首页>A new understanding of RMAN retention policy recovery window
A new understanding of RMAN retention policy recovery window
2022-07-06 09:54:00 【wx5caecf2ed0645】
RDBMS 12.2.0.1
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
Before , I have always believed that this sentence means to keep 7 God (7 Days. ) Backup of . Although before, when operating the database , Found such a setting ,7 Days ahead backup , even to the extent that 10 The backup of days ago has not been deleted , When I feel puzzled , I didn't think much , I know I've seen it again today rman Documents , I found that my previous understanding was wrong ( Maybe I haven't had any sex with myself Oracle The training course is related to , Wrong understanding ).
8.9.1 About the Recovery Window
A recovery window is a period that begins with the current time and extends backward in time to the point of recoverability. The point of recoverability is the earliest time for a hypothetical point-in-time recovery, that is, the earliest point to which you can recover following a media failure.
For example, if you implement a recovery window of 1 week, then RMAN retains full backups and required incremental backups and archived logs so that the database can be recovered up to 7 days in the past. You implement this retention policy as follows:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
This command ensures that for each data file, one backup that is older than the point of recoverability is retained. For example, if the recovery window is 7, then there must always exist one backup of each data file that satisfies the following condition:
SYSDATE - BACKUP CHECKPOINT TIME >= 7
All backups older than the most recent backup that satisfied this condition are obsolete.
Assume the retention policy illustrated in Figure 8-4. The retention policy has the following aspects:
The recovery window is 7 days.
Database backups are scheduled every two weeks on these days:
January 1
January 15
January 29
February 12
The database runs in ARCHIVELOG mode, and archived logs are saved on disk only if needed for the retention policy.
Figure 8-4 Recovery Window, Part 1
Description of "Figure 8-4 Recovery Window, Part 1"
As illustrated in Figure 8-4, the current time is January 23 and the point of recoverability is January 16. Hence, the January 15 backup is needed for recovery, and so are the archived logs from log sequence 500 through 850. The logs before 500 and the January 1 backup are obsolete because they are not needed for recovery to a point within the window.
Assume the same scenario a week later, as depicted in Figure 8-5.
Figure 8-5 Recovery Window, Part 2
Description of "Figure 8-5 Recovery Window, Part 2"
In this scenario, the current time is January 30 and the point of recoverability is January 23. Note how the January 15 backup is not obsolete even though a more recent backup (January 29) exists in the recovery window. This situation occurs because restoring the January 29 backup does not enable you to recover to the earliest time in the window, January 23. To ensure recoverability to any point in the window, you must save the January 15 backup and all archived logs from sequence 500 to 1150.
test :
Set the backup recover window yes 7 God . The backup files are as follows : Yes 12 month 27 Japanese ,1 month 3 Japanese ,1 month 7 Japanese ,2 month 14 Japanese ,3 month 28 Japanese .
[[email protected] backup]$ ll
total 13593292
-rw-r----- 1 oracle oinstall 95455744 Mar 28 10:02 arch_D-TEST_id-2261741601_S-148_T-1_A-2291989017_b1ttid5r
-rw-r----- 1 oracle oinstall 314243584 Feb 14 12:14 arc_TEST_20190214_agtprvur_1_1
-rw-r----- 1 oracle oinstall 1153178624 Mar 28 09:58 arc_TEST_20190328_aqtticm4_2261741601_1_1
-rw-r----- 1 oracle oinstall 1061452800 Mar 28 09:58 arc_TEST_20190328_artticm5_2261741601_1_1
-rw-r----- 1 oracle oinstall 11264 Mar 28 09:58 arc_TEST_20190328_astticuf_2261741601_1_1
-rw-r-----. 1 oracle oinstall 1597956096 Dec 27 12:10 fulldb_TEST_20181227_8btlqoq9_1_1
-rw-r-----. 1 oracle oinstall 1556865024 Jan 3 12:08 fulldb_TEST_20190103_8jtmd7ec_1_1
-rw-r----- 1 oracle oinstall 1532657664 Jan 7 12:09 fulldb_TEST_20190107_8stmnoua_1_1
-rw-r----- 1 oracle oinstall 1195073536 Feb 14 12:10 fulldb_TEST_20190214_actprv69_1_1
-rw-r----- 1 oracle oinstall 2080890880 Feb 14 12:12 fulldb_TEST_20190214_adtprv69_1_1
-rw-r----- 1 oracle oinstall 1220780032 Mar 28 09:52 fulldb_TEST_20190328_anttic4j_2261741601_1_1
-rw-r----- 1 oracle oinstall 2110922752 Mar 28 09:53 fulldb_TEST_20190328_aottic4k_2261741601_1_1
drwxrwxr-x. 3 oracle oinstall 85 Mar 28 09:43 scripts
According to my previous understanding , It's today 3 month 28 Japan , Retain 7 Days of backup ,delete obsolete after ,3 month 21 The backup before the th day will be deleted . In fact, it has not been deleted
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 250 27-DEC-18
Backup Piece 257 27-DEC-18 /data/backup/fulldb_TEST_20181227_8btlqoq9_1_1
Backup Set 259 03-JAN-19
Backup Piece 266 03-JAN-19 /data/backup/fulldb_TEST_20190103_8jtmd7ec_1_1
Backup Set 268 07-JAN-19
Backup Piece 275 07-JAN-19 /data/backup/fulldb_TEST_20190107_8stmnoua_1_1
RMAN> delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 250 27-DEC-18
Backup Piece 257 27-DEC-18 /data/backup/fulldb_TEST_20181227_8btlqoq9_1_1
Backup Set 259 03-JAN-19
Backup Piece 266 03-JAN-19 /data/backup/fulldb_TEST_20190103_8jtmd7ec_1_1
Backup Set 268 07-JAN-19
Backup Piece 275 07-JAN-19 /data/backup/fulldb_TEST_20190107_8stmnoua_1_1
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/data/backup/fulldb_TEST_20181227_8btlqoq9_1_1 RECID=257 STAMP=995976009
deleted backup piece
backup piece handle=/data/backup/fulldb_TEST_20190103_8jtmd7ec_1_1 RECID=266 STAMP=996580813
deleted backup piece
backup piece handle=/data/backup/fulldb_TEST_20190107_8stmnoua_1_1 RECID=275 STAMP=996926411
Deleted 3 objects
RMAN>
You can see 2 month 14 Daily backup still exists . Because the set policy is retention recovery db The time window for is 7 God , It means to recover 7 Within days db, That is, it can recover to 3 month 21 Japanese db The state of . To recover to 3 month 21 Japan , But no 3 month 21 Daily backup , So it uses 2 month 14 Daily backup ,2 month 14 The day is coming 3 month 21 Differences in data , It's through 2 month 14 The day is coming 3 month 21 For recovery . Come here , This problem is clear , My previous understanding was wrong .
[[email protected] backup]$ ll
total 9015664
-rw-r----- 1 oracle oinstall 95455744 Mar 28 10:02 arch_D-TEST_id-2261741601_S-148_T-1_A-2291989017_b1ttid5r
-rw-r----- 1 oracle oinstall 314243584 Feb 14 12:14 arc_TEST_20190214_agtprvur_1_1
-rw-r----- 1 oracle oinstall 1153178624 Mar 28 09:58 arc_TEST_20190328_aqtticm4_2261741601_1_1
-rw-r----- 1 oracle oinstall 1061452800 Mar 28 09:58 arc_TEST_20190328_artticm5_2261741601_1_1
-rw-r----- 1 oracle oinstall 11264 Mar 28 09:58 arc_TEST_20190328_astticuf_2261741601_1_1
-rw-r----- 1 oracle oinstall 1195073536 Feb 14 12:10 fulldb_TEST_20190214_actprv69_1_1
-rw-r----- 1 oracle oinstall 2080890880 Feb 14 12:12 fulldb_TEST_20190214_adtprv69_1_1
-rw-r----- 1 oracle oinstall 1220780032 Mar 28 09:52 fulldb_TEST_20190328_anttic4j_2261741601_1_1
-rw-r----- 1 oracle oinstall 2110922752 Mar 28 09:53 fulldb_TEST_20190328_aottic4k_2261741601_1_1
drwxrwxr-x. 3 oracle oinstall 85 Mar 28 09:43 scripts
边栏推荐
- 【深度学习】语义分割:论文阅读:(CVPR 2022) MPViT(CNN+Transformer):用于密集预测的多路径视觉Transformer
- Cooperative development in embedded -- function pointer
- 五月刷题27——图
- CANoe仿真功能之自动化序列(Automation Sequences )
- [Chongqing Guangdong education] reference materials for nine lectures on the essence of Marxist Philosophy in Wuhan University
- Listen to my advice and learn according to this embedded curriculum content and curriculum system
- Nc29 search in two-dimensional array
- 一大波开源小抄来袭
- Counter attack of noodles: redis asked 52 questions in a series, with detailed pictures and pictures. Now the interview is stable
- If a university wants to choose to study automation, what books can it read in advance?
猜你喜欢
【深度学习】语义分割-源代码汇总
Single chip microcomputer realizes modular programming: Thinking + example + system tutorial (the degree of practicality is appalling)
[CV] target detection: derivation of common terms and map evaluation indicators
Interview shock 62: what are the precautions for group by?
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]
Hero League rotation chart manual rotation
嵌入式开发中的防御性C语言编程
一大波開源小抄來襲
MapReduce instance (VII): single table join
Summary of May training - from a Guang
随机推荐
Une grande vague d'attaques à la source ouverte
Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
[deep learning] semantic segmentation: paper reading: (CVPR 2022) mpvit (cnn+transformer): multipath visual transformer for dense prediction
[Yu Yue education] Wuhan University of science and technology securities investment reference
Cooperative development in embedded -- function pointer
Delayed note learning
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
【深度学习】语义分割-源代码汇总
Several silly built-in functions about relative path / absolute path operation in CAPL script
Control the operation of the test module through the panel in canoe (Advanced)
There are software load balancing and hardware load balancing. Which one to choose?
Leetcode:608 tree node
Defensive C language programming in embedded development
五月刷题01——数组
Regular expressions are actually very simple
Popularization of security knowledge - twelve moves to protect mobile phones from network attacks
五月集训总结——来自阿光
在CANoe中通过Panel面板控制Test Module 运行(高级)
May brush question 01 - array
CAPL 脚本打印函数 write ,writeEx ,writeLineEx ,writeToLog ,writeToLogEx ,writeDbgLevel 你真的分的清楚什么情况下用哪个吗?