Monday, September 5, 2016

RMAN-08139: WARNING: archived redo log not deleted, needed for guaranteed restore point - When does it occure?


Before coming into the topic- lets understand the importance of archivelog files for performing a flashback operation. Flashback Logs contain old versions of Oracle Blocks. But not every Block Modifications leads to the generation of Flashback Logs. Therefore, if you do a flashback database operation, you will never reach exactly the point in time in the past with flashback logs only. You 'grow your datafiles older' than the point in time you want to reach (very much faster than a complete restore from backup would achieve the same). The rest is then recovered with Redo Protocol from Archivelogs or Online Logs. Basically, flashback database does 2 steps under the cover:

1) make datafiles sufficiently old with old blocks from flashback logs
2) recover with redo protocol to the exact point in time you want to get to.


So what might be the behavior of rman delete archivelog command,if you have a guaranteed restore point in your database- lets see what will happen in differnet scenario.

[oracle@mydb01]:[TTREC1] $ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Sep 5 19:07:59 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TTREC (DBID=4201939161)
RMAN>  list backup summary;

using target database control file instead of recovery catalog
specification does not match any backup in the repository
RMAN>

At present, There is no backup.So I will take one full backup.

RMAN> run {
2> sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
3> ALLOCATE CHANNEL disk1 DEVICE TYPE DISK;
4> ALLOCATE CHANNEL disk2 DEVICE TYPE DISK;
5> ALLOCATE CHANNEL disk3 DEVICE TYPE DISK;
6> ALLOCATE CHANNEL disk4 DEVICE TYPE DISK;
7> ALLOCATE CHANNEL disk5 DEVICE TYPE DISK;
8> ALLOCATE CHANNEL disk6 DEVICE TYPE DISK;
9> BACKUP AS COMPRESSED BACKUPSET FULL TAG 'TTREC_BKP_1' DATABASE
10> FORMAT '/t4_nfs_2/TTREC_BKP_1/Backup_%d_%T_%s' INCLUDE CURRENT CONTROLFILE PLUS ARCHIVELOG
11> format '/t4_nfs_2/TTREC_BKP_1/ARCHIVE_%d_%T_%s';
12> }

sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT

allocated channel: disk1
channel disk1: SID=366 device type=DISK

allocated channel: disk2
channel disk2: SID=400 device type=DISK

allocated channel: disk3
channel disk3: SID=433 device type=DISK

allocated channel: disk4
channel disk4: SID=465 device type=DISK

allocated channel: disk5
channel disk5: SID=499 device type=DISK

allocated channel: disk6
channel disk6: SID=532 device type=DISK


Starting backup at 05-SEP-16
current log archived
channel disk1: starting compressed archived log backup set
channel disk1: specifying archived log(s) in backup set
input archived log thread=1 sequence=22 RECID=167 STAMP=921784152
channel disk1: starting piece 1 at 05-SEP-16
channel disk2: starting compressed archived log backup set
channel disk2: specifying archived log(s) in backup set
input archived log thread=1 sequence=16 RECID=161 STAMP=921777078


... output truncated ...


channel disk2: backup set complete, elapsed time: 00:00:37
channel disk3: finished piece 1 at 05-SEP-16
piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_72 tag=TTREC_BKP_1 comment=NONE
channel disk3: backup set complete, elapsed time: 00:00:57
channel disk4: finished piece 1 at 05-SEP-16
piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_73 tag=TTREC_BKP_1 comment=NONE
channel disk4: backup set complete, elapsed time: 00:00:57
Finished backup at 05-SEP-16

Starting backup at 05-SEP-16
current log archived
channel disk1: starting compressed archived log backup set
channel disk1: specifying archived log(s) in backup set
input archived log thread=1 sequence=24 RECID=169 STAMP=921784214
channel disk1: starting piece 1 at 05-SEP-16
channel disk1: finished piece 1 at 05-SEP-16
piece handle=/t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_76 tag=TTREC_BKP_1 comment=NONE
channel disk1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-SEP-16
released channel: disk1
released channel: disk2
released channel: disk3
released channel: disk4
released channel: disk5
released channel: disk6

RMAN>

At this point, I will create one guaranteed restore point.

RMAN> create restore point RP_01 guarantee flashback database ;

Statement processed

I will make a log switch.

RMAN> alter system switch logfile ;

Statement processed

I could see following archive log file(o1_mf_1_25_cwtfrzbf_.arc) got creagted and it should contain th information about the restore point that we took right now.

total 10948
-rw-r----- 1 oracle asmadmin    1024 Sep  5 19:09 o1_mf_1_23_cwtfkvwt_.arc
-rw-r----- 1 oracle asmadmin    3072 Sep  5 19:10 o1_mf_1_24_cwtfmp3b_.arc
-rw-r----- 1 oracle asmadmin   15360 Sep  5 19:13 o1_mf_1_25_cwtfrzbf_.arc

I did few more log switch.

RMAN>

RMAN> alter system switch logfile ;

Statement processed

RMAN>

RMAN> alter system switch logfile ;

Statement processed

RMAN> show all;

RMAN configuration parameters for database with db_unique_name TTREC are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/12.1.0.2/db_1/dbs/snapcf_TTREC1.f'; # default
RMAN> exit
Recovery Manager complete.

From the above output,its clear that default retention policy set to REDUNDANCY 1(default).A redundancy-based retention policy specifies how many backups of each datafile must be retained.
I will create second sets of backup, just to verify how rman will perform ‘delete obsolete’ command with database where we have quaranteed restore point exists.

[oracle@mydb01]:[TTREC1] $ mkdir -p /t4_nfs_2/TTREC_BKP_2
 [oracle@mydb01]:[TTREC1] $ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Sep 5 19:15:22 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TTREC (DBID=4201939161)

RMAN> run {
2> sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
3> ALLOCATE CHANNEL disk1 DEVICE TYPE DISK;
4> ALLOCATE CHANNEL disk2 DEVICE TYPE DISK;
5> ALLOCATE CHANNEL disk3 DEVICE TYPE DISK;
6> ALLOCATE CHANNEL disk4 DEVICE TYPE DISK;
7> ALLOCATE CHANNEL disk5 DEVICE TYPE DISK;
8> ALLOCATE CHANNEL disk6 DEVICE TYPE DISK;
9> BACKUP AS COMPRESSED BACKUPSET FULL TAG 'TTREC_BKP_1' DATABASE
10> FORMAT '/t4_nfs_2/TTREC_BKP_2/Backup_%d_%T_%s' INCLUDE CURRENT CONTROLFILE PLUS ARCHIVELOG
11> format '/t4_nfs_2/TTREC_BKP_2/ARCHIVE_%d_%T_%s';
12> }
using target database control file instead of recovery catalog
sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT
allocated channel: disk1
channel disk1: SID=662 device type=DISK

allocated channel: disk2
channel disk2: SID=366 device type=DISK

allocated channel: disk3
channel disk3: SID=400 device type=DISK

allocated channel: disk4
channel disk4: SID=433 device type=DISK

allocated channel: disk5
channel disk5: SID=465 device type=DISK

allocated channel: disk6
channel disk6: SID=499 device type=DISK
Starting backup at 05-SEP-16
current log archived
channel disk1: starting compressed archived log backup set
channel disk1: specifying archived log(s) in backup set
input archived log thread=1 sequence=21 RECID=166 STAMP=921777332
input archived log thread=1 sequence=22 RECID=167 STAMP=921784152
channel disk1: starting piece 1 at 05-SEP-16
channel disk2: starting compressed archived log backup set
channel disk2: specifying archived log(s) in backup set
input archived log thread=1 sequence=16 RECID=161 STAMP=921777078
channel disk2: starting piece 1 at 05-SEP-16
channel disk3: starting compressed archived log backup set

... output truncated ...


channel disk3: backup set complete, elapsed time: 00:00:56
channel disk4: finished piece 1 at 05-SEP-16
piece handle=/t4_nfs_2/TTREC_BKP_2/Backup_TTREC_20160905_86 tag=TTREC_BKP_1 comment=NONE
channel disk4: backup set complete, elapsed time: 00:00:56
Finished backup at 05-SEP-16
Starting backup at 05-SEP-16
current log archived
channel disk1: starting compressed archived log backup set
channel disk1: specifying archived log(s) in backup set
input archived log thread=1 sequence=30 RECID=175 STAMP=921784591
channel disk1: starting piece 1 at 05-SEP-16
channel disk1: finished piece 1 at 05-SEP-16
piece handle=/t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_89 tag=TTREC_BKP_1 comment=NONE
channel disk1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-SEP-16
released channel: disk1
released channel: disk2
released channel: disk3
released channel: disk4
released channel: disk5
released channel: disk6
RMAN> exit
Recovery Manager complete.

Here I wil try to delete archivelog with following command

[oracle@mydb01]:[TTREC1] $ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Sep 5 19:17:21 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TTREC (DBID=4201939161)

RMAN> list backup summary;

using target database control file instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
59      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
60      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
61      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
62      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
63      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
64      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
65      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
66      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
67      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
68      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
69      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
70      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
71      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
72      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
73      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
74      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
75      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
76      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
77      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
78      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
79      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
80      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
81      B  F  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1
82      B  A  A DISK        05-SEP-16       1       1       YES        TTREC_BKP_1

RMAN> DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 1 TIMES TO DEVICE TYPE DISK;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=366 device type=DISK
RMAN-08139: WARNING: archived redo log not deleted, needed for guaranteed restore point
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_25_cwtfrzbf_.arc thread=1 sequence=25
List of Archived Log Copies for database with db_unique_name TTREC
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
161     1    16      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_16_cwt6np93_.arc

166     1    21      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_21_cwt6wn4n_.arc

167     1    22      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_22_cwtfkr9v_.arc

168     1    23      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_23_cwtfkvwt_.arc

169     1    24      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_24_cwtfmp3b_.arc

171     1    26      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_26_cwtftcz4_.arc

172     1    27      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_27_cwtftghz_.arc

173     1    28      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_28_cwtfxkk0_.arc

174     1    29      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_29_cwtfxo2r_.arc

175     1    30      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_30_cwtfzhd9_.arc

deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_16_cwt6np93_.arc RECID=161 STAMP=921777078
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_21_cwt6wn4n_.arc RECID=166 STAMP=921777332
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_22_cwtfkr9v_.arc RECID=167 STAMP=921784152
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_23_cwtfkvwt_.arc RECID=168 STAMP=921784155
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_24_cwtfmp3b_.arc RECID=169 STAMP=921784214
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_26_cwtftcz4_.arc RECID=171 STAMP=921784427
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_27_cwtftghz_.arc RECID=172 STAMP=921784430
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_28_cwtfxkk0_.arc RECID=173 STAMP=921784529
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_29_cwtfxo2r_.arc RECID=174 STAMP=921784533
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_30_cwtfzhd9_.arc RECID=175 STAMP=921784591
Deleted 10 objects
RMAN>

RMAN deleted all the archivelog files except the one required for a guaranteed restore point(o1_mf_1_25_cwtfrzbf_.arc).

I did few more log switch.

RMAN> alter system switch logfile ;

Statement processed

RMAN> alter system switch logfile ;

Statement processed

RMAN> delete archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=366 device type=DISK
RMAN-08139: WARNING: archived redo log not deleted, needed for guaranteed restore point
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_25_cwtfrzbf_.arc thread=1 sequence=25
List of Archived Log Copies for database with db_unique_name TTREC
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
176     1    31      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_31_cwtg3bf4_.arc

177     1    32      A 05-SEP-16
        Name: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_32_cwtg3mpw_.arc


Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_31_cwtg3bf4_.arc RECID=176 STAMP=921784714
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_32_cwtg3mpw_.arc RECID=177 STAMP=921784723
Deleted 2 objects

Again RMAN reported the same error.

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           62     05-SEP-16
  Backup Piece       63     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_66
Backup Set           61     05-SEP-16
  Backup Piece       62     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_67
Backup Set           59     05-SEP-16
  Backup Piece       60     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_68
Backup Set           60     05-SEP-16
  Backup Piece       61     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_69
Backup Set           65     05-SEP-16
  Backup Piece       66     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_70
Backup Set           66     05-SEP-16
  Backup Piece       67     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_71
Backup Set           68     05-SEP-16
  Backup Piece       69     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_72
Backup Set           67     05-SEP-16
  Backup Piece       68     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_73
Backup Set           64     05-SEP-16
  Backup Piece       65     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_74
Backup Set           63     05-SEP-16
  Backup Piece       64     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_75
Backup Set           69     05-SEP-16
  Backup Piece       70     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_76
Backup Set           75     05-SEP-16
  Backup Piece       76     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_77
Backup Set           74     05-SEP-16
  Backup Piece       75     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_78
Backup Set           70     05-SEP-16
  Backup Piece       71     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_79
Backup Set           71     05-SEP-16
  Backup Piece       72     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_80
Backup Set           72     05-SEP-16
  Backup Piece       73     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_81
Backup Set           73     05-SEP-16
  Backup Piece       74     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_82

I will take one more backup of my archivelog files.So that my archivelog file should be a candidate for rman obsolete command.

RMAN> alter system switch logfile;

Statement processed

RMAN> backup ARCHIVELOG all;

Starting backup at 05-SEP-16
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=25 RECID=170 STAMP=921784383
input archived log thread=1 sequence=33 RECID=178 STAMP=921784856
input archived log thread=1 sequence=34 RECID=179 STAMP=921784882
channel ORA_DISK_1: starting piece 1 at 05-SEP-16
channel ORA_DISK_1: finished piece 1 at 05-SEP-16
piece handle=/data2/TTREC/backupset/2016_09_05/o1_mf_annnn_TAG20160905T192122_cwtg8lff_.bkp tag=TAG20160905T192122 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-SEP-16

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           62     05-SEP-16
  Backup Piece       63     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_66
Backup Set           61     05-SEP-16
  Backup Piece       62     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_67
Backup Set           59     05-SEP-16
  Backup Piece       60     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_68
Backup Set           60     05-SEP-16
  Backup Piece       61     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_69
Backup Set           65     05-SEP-16
  Backup Piece       66     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_70
Backup Set           66     05-SEP-16
  Backup Piece       67     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_71
Backup Set           68     05-SEP-16
  Backup Piece       69     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_72
Backup Set           67     05-SEP-16
  Backup Piece       68     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_73
Backup Set           64     05-SEP-16
  Backup Piece       65     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_74
Backup Set           63     05-SEP-16
  Backup Piece       64     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_75
Backup Set           69     05-SEP-16
  Backup Piece       70     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_76
Backup Set           75     05-SEP-16
  Backup Piece       76     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_77
Backup Set           74     05-SEP-16
  Backup Piece       75     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_78
Backup Set           70     05-SEP-16
  Backup Piece       71     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_79
Backup Set           71     05-SEP-16
  Backup Piece       72     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_80
Backup Set           72     05-SEP-16
  Backup Piece       73     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_81
Backup Set           73     05-SEP-16
  Backup Piece       74     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_82

RMAN haven’t listed that archivelog file as obsolete .I am gonna delete my guaranteed resote point and will check again.

RMAN> select name from v$restore_point;



NAME
------------------------------------

RP_01


RMAN> drop restore point RP_01;

Statement processed

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           62     05-SEP-16
  Backup Piece       63     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_66
Backup Set           61     05-SEP-16
  Backup Piece       62     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_67
Backup Set           59     05-SEP-16
  Backup Piece       60     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_68
Backup Set           60     05-SEP-16
  Backup Piece       61     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_69
Backup Set           65     05-SEP-16
  Backup Piece       66     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_70
Backup Set           66     05-SEP-16
  Backup Piece       67     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_71
Backup Set           68     05-SEP-16
  Backup Piece       69     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_72
Backup Set           67     05-SEP-16
  Backup Piece       68     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_73
Backup Set           64     05-SEP-16
  Backup Piece       65     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_74
Backup Set           63     05-SEP-16
  Backup Piece       64     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_75
Archive Log          170    05-SEP-16          /data2/TTREC/archivelog/2016_09_05/o1_mf_1_25_cwtfrzbf_.arc
Backup Set           69     05-SEP-16
  Backup Piece       70     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_76
Backup Set           75     05-SEP-16
  Backup Piece       76     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_77
Backup Set           74     05-SEP-16
  Backup Piece       75     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_78
Backup Set           70     05-SEP-16
  Backup Piece       71     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_79
Backup Set           71     05-SEP-16
  Backup Piece       72     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_80
Backup Set           72     05-SEP-16
  Backup Piece       73     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_81
Backup Set           73     05-SEP-16
  Backup Piece       74     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_82

RMAN>
RMAN> delete obsolete ;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=761 device type=DISK
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           62     05-SEP-16
  Backup Piece       63     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_66
Backup Set           61     05-SEP-16
  Backup Piece       62     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_67
Backup Set           59     05-SEP-16
  Backup Piece       60     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_68
Backup Set           60     05-SEP-16
  Backup Piece       61     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_69
Backup Set           65     05-SEP-16
  Backup Piece       66     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_70
Backup Set           66     05-SEP-16
  Backup Piece       67     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_71
Backup Set           68     05-SEP-16
  Backup Piece       69     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_72
Backup Set           67     05-SEP-16
  Backup Piece       68     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_73
Backup Set           64     05-SEP-16
  Backup Piece       65     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_74
Backup Set           63     05-SEP-16
  Backup Piece       64     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_75
Archive Log          170    05-SEP-16          /data2/TTREC/archivelog/2016_09_05/o1_mf_1_25_cwtfrzbf_.arc
Backup Set           69     05-SEP-16
  Backup Piece       70     05-SEP-16          /t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_76
Backup Set           75     05-SEP-16
  Backup Piece       76     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_77
Backup Set           74     05-SEP-16
  Backup Piece       75     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_78
Backup Set           70     05-SEP-16
  Backup Piece       71     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_79
Backup Set           71     05-SEP-16
  Backup Piece       72     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_80
Backup Set           72     05-SEP-16
  Backup Piece       73     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_81
Backup Set           73     05-SEP-16
  Backup Piece       74     05-SEP-16          /t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_82

Do you really want to delete the above objects (enter YES or NO)? YES
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_66 RECID=63 STAMP=921784156
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_67 RECID=62 STAMP=921784156
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_68 RECID=60 STAMP=921784156
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_69 RECID=61 STAMP=921784156
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_70 RECID=66 STAMP=921784157
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_71 RECID=67 STAMP=921784157
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_72 RECID=69 STAMP=921784157
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_73 RECID=68 STAMP=921784157
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_74 RECID=65 STAMP=921784159
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/Backup_TTREC_20160905_75 RECID=64 STAMP=921784157
deleted archived log
archived log file name=/data2/TTREC/archivelog/2016_09_05/o1_mf_1_25_cwtfrzbf_.arc RECID=170 STAMP=921784383
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_1/ARCHIVE_TTREC_20160905_76 RECID=70 STAMP=921784214
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_77 RECID=76 STAMP=921784533
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_78 RECID=75 STAMP=921784533
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_79 RECID=71 STAMP=921784533
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_80 RECID=72 STAMP=921784533
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_81 RECID=73 STAMP=921784533
deleted backup piece
backup piece handle=/t4_nfs_2/TTREC_BKP_2/ARCHIVE_TTREC_20160905_82 RECID=74 STAMP=921784533
Deleted 18 objects

RMAN> exit
 Recovery Manager complete.
 
[oracle@ehrsvpitoel02]:[TTREC1] $ ls -lrt /data2/TTREC/archivelog/2016_09_05/o1_mf_1_25_cwtfrzbf_.arc
ls: /data2/TTREC/archivelog/2016_09_05/o1_mf_1_25_cwtfrzbf_.arc: No such file or directory
[oracle@ehrsvpitoel02]:[TTREC1] $


Conclusion:-
RMAN basically wont delete archive log files that are really required for a guaranteed restore point. Files in the fast recovery area are not eligible for deletion if they are required to satisfy a guaranteed restore point.
However, archived redo logs required to satisfy a guaranteed restore point may be deleted after they are backed up to disk or tape
when there was a space pressure in FRA. When you use the RMAN FLASHBACK DATABASE command, if the archived redo logs required to satisfy a specified guaranteed restore point are notavailable in the fast recovery area, they are restored from the backups.
The retention policy affects archived redo logs and level 1 incremental backups. First, RMAN decides which datafile and control file backups are obsolete. Then, RMAN considers as obsolete all archived logs and incremental level 1 backups that are not needed to recover the oldest datafile or control file backup that must be retained.


2 comments: