当前位置:网站首页>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
边栏推荐
- 单片机如何从上电复位执行到main函数?
- CANoe不能自动识别串口号?那就封装个DLL让它必须行
- Control the operation of the test module through the panel in canoe (Advanced)
- Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
- Interview shock 62: what are the precautions for group by?
- Why is 51+ assembly in college SCM class? Why not come directly to STM32
- 华南技术栈CNN+Bilstm+Attention
- 51单片机进修的一些感悟
- 六月刷题02——字符串
- Leetcode:608 tree node
猜你喜欢

Take you back to spark ecosystem!

C杂讲 动态链表操作 再讲

CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?

Combined search /dfs solution - leetcode daily question - number of 1020 enclaves

Counter attack of noodles: redis asked 52 questions in a series, with detailed pictures and pictures. Now the interview is stable

Why can't TN-C use 2p circuit breaker?

What are the models of data modeling

Research and implementation of hospital management inpatient system based on b/s (attached: source code paper SQL file)

Nc29 search in two-dimensional array
![[CV] target detection: derivation of common terms and map evaluation indicators](/img/e8/04cc8336223c0ab2dea5638def88df.jpg)
[CV] target detection: derivation of common terms and map evaluation indicators
随机推荐
DCDC power ripple test
Elk project monitoring platform deployment + deployment of detailed use (II)
How does the single chip microcomputer execute the main function from power on reset?
一大波开源小抄来袭
Scoped in webrtc_ refptr
嵌入式开发比单片机要难很多?谈谈单片机和嵌入式开发设计经历
Learning SCM is of great help to society
CAPL 脚本打印函数 write ,writeEx ,writeLineEx ,writeToLog ,writeToLogEx ,writeDbgLevel 你真的分的清楚什么情况下用哪个吗?
学习单片机对社会的帮助是很大的
五月刷题01——数组
美新泽西州州长签署七项提高枪支安全的法案
MapReduce instance (VII): single table join
June brush question 02 - string
Day 5 of MySQL learning
If a university wants to choose to study automation, what books can it read in advance?
Hero League rotation map automatic rotation
Mapreduce实例(四):自然排序
【深度学习】语义分割-源代码汇总
竞赛vscode配置指南
[Yu Yue education] reference materials of power electronics technology of Jiangxi University of science and technology