当前位置:网站首页>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
边栏推荐
- 大学想要选择学习自动化专业,可以看什么书去提前了解?
- 在CANoe中通过Panel面板控制Test Module 运行(高级)
- Delayed note learning
- Mapreduce实例(四):自然排序
- 美新泽西州州长签署七项提高枪支安全的法案
- Basic concepts of libuv
- June brush question 02 - string
- Hero League rotation chart manual rotation
- 33岁可以学PLC吗
- Listen to my advice and learn according to this embedded curriculum content and curriculum system
猜你喜欢
DCDC power ripple test
听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
Summary of May training - from a Guang
MapReduce instance (IV): natural sorting
学习单片机对社会的帮助是很大的
What you have to know about network IO model
Mapreduce实例(九):Reduce端join
华南技术栈CNN+Bilstm+Attention
CAPL 脚本打印函数 write ,writeEx ,writeLineEx ,writeToLog ,writeToLogEx ,writeDbgLevel 你真的分的清楚什么情况下用哪个吗?
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
随机推荐
Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
单片机实现模块化编程:思维+实例+系统教程(实用程度令人发指)
May brush question 02 - string
发生OOM了,你知道是什么原因吗,又该怎么解决呢?
C杂讲 文件 续讲
Libuv thread
Selection of software load balancing and hardware load balancing
33岁可以学PLC吗
Hugo blog graphical writing tool -- QT practice
Hero League rotation chart manual rotation
为什么大学单片机课上51+汇编,为什么不直接来STM32
Automation sequences of canoe simulation functions
CANoe下载地址以及CAN Demo 16的下载与激活,并附录所有CANoe软件版本
C杂讲 文件 初讲
MapReduce instance (VI): inverted index
Function description of shell command parser
Some thoughts on the study of 51 single chip microcomputer
If a university wants to choose to study automation, what books can it read in advance?
June brush question 02 - string
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?