当前位置:网站首页>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
边栏推荐
- 竞赛vscode配置指南
- max-flow min-cut
- MapReduce instance (VII): single table join
- May brush question 27 - figure
- Hero League rotation chart manual rotation
- Elk project monitoring platform deployment + deployment of detailed use (II)
- 听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
- CANoe CAPL文件操作目录合集
- vscode 常用的指令
- Nc17 longest palindrome substring
猜你喜欢
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
Control the operation of the test module through the panel in canoe (Advanced)
CAPL 脚本对.ini 配置文件的高阶操作
CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
Automation sequences of canoe simulation functions
MapReduce instance (VI): inverted index
max-flow min-cut
Hero League rotation map automatic rotation
Mapreduce实例(四):自然排序
Hard core! One configuration center for 8 classes!
随机推荐
五月刷题03——排序
Day 5 of MySQL learning
[untitled]
VH6501学习系列文章
Une grande vague d'attaques à la source ouverte
Webrtc blog reference:
硬件工程师的真实前途我说出来可能你们不信
学习单片机对社会的帮助是很大的
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
五月集训总结——来自阿光
[Yu Yue education] reference materials of power electronics technology of Jiangxi University of science and technology
嵌入式开发比单片机要难很多?谈谈单片机和嵌入式开发设计经历
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
Defensive C language programming in embedded development
嵌入式中的合作开发--函数指针
What you have to know about network IO model
Can I learn PLC at the age of 33
DCDC power ripple test
How does the single chip microcomputer execute the main function from power on reset?
Popularization of security knowledge - twelve moves to protect mobile phones from network attacks