当前位置:网站首页>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
边栏推荐
猜你喜欢
Mapreduce实例(五):二次排序
Defensive C language programming in embedded development
[deep learning] semantic segmentation - source code summary
PR 2021 quick start tutorial, first understanding the Premiere Pro working interface
Mapreduce实例(七):单表join
[deep learning] semantic segmentation: thesis reading (neurips 2021) maskformer: per pixel classification is not all you need
零基础学习单片机切记这四点要求,少走弯路
CANoe的数据回放(Replay Block),还是要结合CAPL脚本才能说的明白
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
The replay block of canoe still needs to be combined with CAPL script to make it clear
随机推荐
Bugku web guide
CAPL script pair High level operation of INI configuration file
Function description of shell command parser
Several silly built-in functions about relative path / absolute path operation in CAPL script
max-flow min-cut
大学想要选择学习自动化专业,可以看什么书去提前了解?
Webrtc blog reference:
在CANoe中通过Panel面板控制Test Module 运行(高级)
嵌入式开发中的防御性C语言编程
Vs All comments and uncomments
[flask] crud addition and query operation of data
Cap theory
33岁可以学PLC吗
Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
MapReduce instance (IV): natural sorting
华南技术栈CNN+Bilstm+Attention
Day 5 of MySQL learning
CANoe的数据回放(Replay Block),还是要结合CAPL脚本才能说的明白
Basic concepts of libuv
Mapreduce实例(十):ChainMapReduce