- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
12#
发表于 2013-10-9 16:36:01
本来以为可能是keep until 导致了该问题
RMAN archivelog backups are not becoming obsoleted (Doc ID 986382.1) To BottomTo Bottom
Applies to:
Oracle Database - Enterprise Edition - Version 9.2.0.1 and later
Information in this document applies to any platform.
Symptoms
Assumptions: this is a simple database configuration. There is no standby, no flashback logs, no streams. All files are online and not in need of backups.
RMAN does not appear to consider regular archivelog backups as obsolete even though the retention period has passed there are full backups taken subsequently.
Consider the following backups:
sql 'alter system switch logfile';
run {
allocate channel d1 device type disk maxopenfiles 1 rate 5m;
backup full tag 'LB_KEEP1DAY' format '/tmp/full_1day_%U'
keep until time 'trunc(sysdate)+1' logs
(database skip offline include current controlfile);
backup tag 'LB_ARC' format '/tmp/arch_%U'
archivelog all
delete input;
}
The backups taken over time:
[oracle@osbr-linux testcase]$ rman target / catalog rman/rman@Rcat
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Feb 24 16:01:19 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA112 (DBID=232055638)
connected to recovery catalog database
RMAN> list backup summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------ ------- ------- ---------- ---
48 B F A DISK 02 FEB 10 15:30:40 1 1 NO LB_KEEP1DAY
72 B F A DISK 02 FEB 10 15:44:31 1 1 NO LB_KEEP1DAY
73 B F A DISK 02 FEB 10 15:44:36 1 1 NO LB_KEEP1DAY
98 B A A DISK 02 FEB 10 15:44:44 1 1 NO LB_ARC
133 B F A DISK 03 FEB 10 08:14:45 1 1 NO LB_KEEP1DAY
134 B F A DISK 03 FEB 10 08:14:49 1 1 NO LB_KEEP1DAY
159 B A A DISK 03 FEB 10 08:15:12 1 1 NO LB_ARC
775 B F A DISK 12 FEB 10 15:49:49 1 1 NO LB_KEEP1DAY
776 B F A DISK 12 FEB 10 15:49:55 1 1 NO LB_KEEP1DAY
800 B A A DISK 12 FEB 10 15:51:13 1 1 NO LB_ARC
1265 B F A DISK 24 FEB 10 15:55:02 1 1 NO LB_NOKEEP
1266 B F A DISK 24 FEB 10 15:55:08 1 1 NO LB_NOKEEP
1302 B A A DISK 24 FEB 10 15:59:26 1 1 NO LB_ARC
Note: FULL backupsets 1265 and 1266 were taken with the option of keep until time 'trunc(sysdate)+1'
On the 24th of February, only the backups with KEEP options are reported as obsolete as they have past their KEEP period. The archivelog backups are NOT listed as obsolete.
[oracle@osbr-linux testcase]$ rman target / catalog rman/rman@Rcat
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Feb 24 16:02:34 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA112 (DBID=232055638)
connected to recovery catalog database
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 3 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 48 02 FEB 10 15:30:40
Backup Piece 49 02 FEB 10 15:30:40 /tmp/full_1day_02l50vgu_1_1
Backup Set 72 02 FEB 10 15:44:31
Backup Piece 76 02 FEB 10 15:44:31 /tmp/full_1day_03l5101f_1_1
Backup Set 73 02 FEB 10 15:44:36
Backup Piece 77 02 FEB 10 15:44:36 /tmp/full_1day_04l510b1_1_1
Backup Set 133 03 FEB 10 08:14:45
Backup Piece 137 03 FEB 10 08:14:45 /tmp/full_1day_06l52q25_1_1
Backup Set 134 03 FEB 10 08:14:49
Backup Piece 138 03 FEB 10 08:14:49 /tmp/full_1day_07l52qbn_1_1
Backup Set 775 12 FEB 10 15:49:49
Backup Piece 777 12 FEB 10 15:49:49 /tmp/full_1day_0ol5rbup_1_1
Backup Set 776 12 FEB 10 15:49:55
Backup Piece 778 12 FEB 10 15:49:55 /tmp/full_1day_0pl5rcd1_1_1
Changes
Full database backups are taken with the KEEP option.
Cause
The KEEP option specifies that the backup should be exempt from the retention policy either forever or for a specified period of time. The general name for a backup created with BACKUP ... KEEP is an archival backup.
Bug 10152820 - closed as not a bug:
KEEP backups in 11g no long play in the same sandbox as other DR backups. The feature was expanded in 11g to provide an archival backup mechanism that
would not disturb nightly backup activity. In general a KEEP backup only
knows about other KEEP backups with the same TAG.
Regular archivelog backups will only become obsolete if there is a full or level 0 backup taken, and these backups fall outside the retention policy.
Solution
In order for regular archivelog backups to become obsolete, we must also take full non-archival backups. That is, a FULL or level 0 backup WITHOUT the KEEP option.
On Mar 1, the archivelog backups have finally become obsolete:
[oracle@osbr-linux testcase]$ rman target / catalog rman/rman@rcat
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Mar 1 10:30:49 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA112 (DBID=232055638)
connected to recovery catalog database
RMAN> list backup summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------ ------- ------- ---------- ---
48 B F A DISK 02 FEB 10 15:30:40 1 1 NO LB_KEEP1DAY
72 B F A DISK 02 FEB 10 15:44:31 1 1 NO LB_KEEP1DAY
73 B F A DISK 02 FEB 10 15:44:36 1 1 NO LB_KEEP1DAY
98 B A A DISK 02 FEB 10 15:44:44 1 1 NO LB_ARC
133 B F A DISK 03 FEB 10 08:14:45 1 1 NO LB_KEEP1DAY
134 B F A DISK 03 FEB 10 08:14:49 1 1 NO LB_KEEP1DAY
159 B A A DISK 03 FEB 10 08:15:12 1 1 NO LB_ARC
775 B F A DISK 12 FEB 10 15:49:49 1 1 NO LB_KEEP1DAY
776 B F A DISK 12 FEB 10 15:49:55 1 1 NO LB_KEEP1DAY
800 B A A DISK 12 FEB 10 15:51:13 1 1 NO LB_ARC
1265 B F A DISK 24 FEB 10 15:55:02 1 1 NO LB_NOKEEP
1266 B F A DISK 24 FEB 10 15:55:08 1 1 NO LB_NOKEEP
1302 B A A DISK 24 FEB 10 15:59:26 1 1 NO LB_ARC
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 3 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 48 02 FEB 10 15:30:40
Backup Piece 49 02 FEB 10 15:30:40 /tmp/full_1day_02l50vgu_1_1
Backup Set 72 02 FEB 10 15:44:31
Backup Piece 76 02 FEB 10 15:44:31 /tmp/full_1day_03l5101f_1_1
Backup Set 73 02 FEB 10 15:44:36
Backup Piece 77 02 FEB 10 15:44:36 /tmp/full_1day_04l510b1_1_1
Backup Set 98 02 FEB 10 15:44:44
Backup Piece 101 02 FEB 10 15:44:44 /tmp/arch_05l510bb_1_1
Backup Set 133 03 FEB 10 08:14:45
Backup Piece 137 03 FEB 10 08:14:45 /tmp/full_1day_06l52q25_1_1
Backup Set 134 03 FEB 10 08:14:49
Backup Piece 138 03 FEB 10 08:14:49 /tmp/full_1day_07l52qbn_1_1
Backup Set 159 03 FEB 10 08:15:12
Backup Piece 162 03 FEB 10 08:15:12 /tmp/arch_08l52qc2_1_1
Backup Set 775 12 FEB 10 15:49:49
Backup Piece 777 12 FEB 10 15:49:49 /tmp/full_1day_0ol5rbup_1_1
Backup Set 776 12 FEB 10 15:49:55
Backup Piece 778 12 FEB 10 15:49:55 /tmp/full_1day_0pl5rcd1_1_1
Backup Set 800 12 FEB 10 15:51:13
Backup Piece 803 12 FEB 10 15:51:13 /tmp/arch_0ql5rcdj_1_1
MORE INFO:Bug 7828095: OBSOLETE BACKUPSET ARE NOT DELETED FROM THE FRA AUTOMATICALLY
|
|