If an archived backup set exceeds the backup retention policy, report obsolete reports that it has expired. therefore, the Backup Redundancy policy is set to 1, and the archive is backed up twice. The report obsolete command is initiated to view the expired archive backup set, but the result does not show the backup set obsolete, it seems that it is necessary to make a good research, so there are the following.
First, let's take a look at the official instructions on the report obsolete command.
Lists full backups, data file copies, and archived redo log files recorded in
RMAN repository that can be deleted because they are no longer needed The command works
In two steps:
For each data file that has been backed up, RMAN identifies the oldest full
Backup, level 0 backup, or image copy that is not obsolete under
Retention policy. Any backup of the data file older than the one identified in
This step is considered obsolete.
Any archived redo log files and level 1 incremental backups that are older
Than the oldest nonobsolete full backup are considered obsolete. These files
Are obsolete because no full or level 0 backup exists to which they can be
Applied. Incremental level 1 backups or archived redo log files are not
Considered obsolete if they can be applied to nonobsolete level 0 or full
Backups.
Section 1:
The report obsolete command is used to list all deleted backups, copy data files, and archive logs in the rman database.
The report obsolete command has two processes.
Section 2:
Processing of data file backup: for each data file that has been backed up, rman identifies the oldest full data backup or level 0 backup in the retention policy, if any other data file backup is older than the identified backup, this step is taken as an obsolete.
Section 3
Processing of archived log files or Incremental Backup:
First, there should be a reference. This reference is the oldest non-obsolete full backup or level 0 backup in the retention policy.
If the archive file or Incremental backup is older than the identified non-obsolete and the oldest full backup, it is regarded as obsolete.
If the archive file or Incremental Backup can be applied to a non-obsolete full backup or zero-level backup, the archive and Incremental backup is not obsolete, and the reverse is obsolete.
Second Verification
1. The current database backup retention policy configuration is as follows:
RMAN> show all;
Using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name CRM are:
Configure retention policy to redundancy 1;
2. the obsolete backup set of the current database is as follows:
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
No obsolete backups found
3. Back up all archives of the database twice.
RMAN> run {
2> allocate channel c1 type disk;
3> backup archivelog all format'/backup/arch2 _ % T _ % U ';
4> release channel c1;
5>}
Released channel: ORA_DISK_1
Released channel: ORA_DISK_2
Released channel: ORA_DISK_3
Allocated channel: c1
Channel c1: SID = 131 device type = DISK
Starting backup at 2013-03-27 16:15:47
Current log archived
Channel c1: starting archived log backup set
Channel c1: specifying archived log (s) in backup set
Input archived log thread = 1 sequence = 124 RECID = 843 STAMP = 811181727
Input archived log thread = 1 sequence = 125 RECID = 844 STAMP = 811181727
Input archived log thread = 1 sequence = 126 RECID = 845 STAMP = 811181728
Input archived log thread = 1 sequence = 127 RECID = 846 STAMP = 811181729
Input archived log thread = 1 sequence = 128 RECID = 847 STAMP = 811181729
Input archived log thread = 1 sequence = 129 RECID = 848 STAMP = 811181730
Input archived log thread = 1 sequence = 130 RECID = 849 STAMP = 811181747
Channel c1: starting piece 1 at 2013-03-27 16:15:48
Channel c1: finished piece 1 at 2013-03-27 16:15:49
Piece handle =/backup/arch2_20130327_0mo5j9lj_1_1 tag = TAG20130327T161547 comment = NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 2013-03-27 16:15:49
Starting Control File and SPFILE Autobackup at 2013-03-27 16:15:49
Piece handle =/backup/c-3599153036-20130327-04 comment = NONE
Finished Control File and SPFILE Autobackup at 2013-03-27 16:15:50
Released channel: c1
RMAN> run {
2> allocate channel c1 type disk;
3> backup archivelog all format'/backup/arch2 _ % T _ % U ';
4> release channel c1;
5>}
Allocated channel: c1
Channel c1: SID = 131 device type = DISK
Starting backup at 2013-03-27 16:15:56
Current log archived
Channel c1: starting archived log backup set
Channel c1: specifying archived log (s) in backup set
Input archived log thread = 1 sequence = 124 RECID = 843 STAMP = 811181727
Input archived log thread = 1 sequence = 125 RECID = 844 STAMP = 811181727
Input archived log thread = 1 sequence = 126 RECID = 845 STAMP = 811181728
Input archived log thread = 1 sequence = 127 RECID = 846 STAMP = 811181729
Input archived log thread = 1 sequence = 128 RECID = 847 STAMP = 811181729
Input archived log thread = 1 sequence = 129 RECID = 848 STAMP = 811181730
Input archived log thread = 1 sequence = 130 RECID = 849 STAMP = 811181747
Input archived log thread = 1 sequence = 131 RECID = 850 STAMP = 811181756
Channel c1: starting piece 1 at 2013-03-27 16:15:56
Channel c1: finished piece 1 at 2013-03-27 16:15:57
Piece handle =/backup/arch2_20130327_0oo5j9ls_1_1 tag = TAG20130327T161556 comment = NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 2013-03-27 16:15:57
Starting Control File and SPFILE Autobackup at 2013-03-27 16:15:57
Piece handle =/backup/c-3599153036-20130327-05 comment = NONE
Finished Control File and SPFILE Autobackup at 2013-03-27 16:15:58
Released channel: c1
4. view the report obsolete again and find that there is no archive backup set obsolete.
Note: As of now, the database has not been fully backed up, that is, the oldest nonobsolete full backup is lacking in comparison ".
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 838 16:09:54
Backup Piece 847 16:09:54/backup/c-3599153036-20130327-03
Backup Set 840 16:15:50
Backup Piece 849 16:15:50/backup/c-3599153036-20130327-04
5. A full database backup will generate the "the oldest nonobsolete full backup ")
RMAN> run {
2> allocate channel c1 type disk;
3> backup database format'/backup/fulldb _ % T _ % U ';
4> release channel c1;
5>}
Allocated channel: c1
Channel c1: SID = 131 device type = DISK
Starting backup at 2013-03-27 16:16:58
Channel c1: starting full datafile backup set
Channel c1: specifying datafile (s) in backup set
Input datafile file number = 00004 name =/oracle/CRM/test2/USERS4.dbf
Input datafile file number = 00001 name =/oracle/CRM/test2/SYSTEM1.dbf
Input datafile file number = 00002 name =/oracle/CRM/test2/SYSAUX2.dbf
Input datafile file number = 00005 name =/oracle/CRM/test2/pos1.dbf
Input datafile file number = 00003 name =/oracle/CRM/test2/UNDOTBS33.dbf
Input datafile file number = 00006 name =/oracle/CRM/test2/ERP6.dbf
Input datafile file number = 00009 name =/oracle/CRM/test2/pos2.dbf
Input datafile file number = 00007 name =/oracle/CRM/test2/USER017.dbf
Input datafile file number = 00008 name =/oracle/CRM/test2/TEST8.dbf
Channel c1: starting piece 1 at 2013-03-27 16:16:58
Channel c1: finished piece 1 at 2013-03-27 16:19:43
Piece handle =/backup/fulldb_20130327_0qo5j9nq_1_1 tag = TAG20130327T161658 comment = NONE
Channel c1: backup set complete, elapsed time: 00:02:46
Finished backup at 2013-03-27 16:19:44
Starting Control File and SPFILE Autobackup at 2013-03-27 16:19:44
Piece handle =/backup/c-3599153036-20130327-06 comment = NONE
Finished Control File and SPFILE Autobackup at 2013-03-27 16:19:47
Released channel: c1
6. The database logs are as follows. You can find that the last archived seq number in oracle is 131)
SQL> select group #, archived, sequence #, status from v $ Log;
GROUP # arc sequence # STATUS
---------------------------------------
1 YES 129 INACTIVE
2 yes130 INACTIVE
3 yes131 INACTIVE
4 NO 132 CURRENT
7Now we initiate the report obsolete command, all the archive backup sets and archive files in the system are compared with the oldest nonobsolete full backup in the retention policy. All useless archive backup sets and archive logs are marked as obsolete in the rman database.
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 837 16:09:48
Backup Piece 846 16:09:48/backup/fulldb1_20130327_0ho5j95g_1_1
Archive Log 844 16:15:27/oracle/archive/export 125_810495590.dbf
Backup Set 838 16:09:54
Backup Piece 847 16:09:54/backup/c-3599153036-20130327-03
Archive Log 843 16:15:27/oracle/archive/2017124_810495590.dbf
Archive Log 845 16:15:28/oracle/archive/2017126_810495590.dbf
Archive Log 846 16:15:29/oracle/archive/zookeeper _810495590.dbf
Archive Log 847 16:15:29/oracle/archive/2017128_810495590.dbf
Archive Log 848 16:15:30/oracle/archive/2017129_810495590.dbf
Archive Log 849 16:15:47/oracle/archive/logs 130_810495590.dbf
Backup Set 839 16:15:48
Backup Piece 848 16:15:48/backup/arch2_20130327_0mo5j9lj_1_1
Backup Set 840 16:15:50
Backup Piece 849 16:15:50/backup/c-3599153036-20130327-04
Archive Log 850 16:15:56/oracle/archive/zookeeper _810495590.dbf
Backup Set 841 16:15:56
Backup Piece 850 16:15:56/backup/arch2_20130327_0oo5j9ls_1_1
Backup Set 842 16:15:58
Backup Piece 851 16:15:58/backup/c-3599153036-20130327-05
Summary:
1. If the archive backup set is obsolete, the archive contained in the backup set does not need to be applied to a full backup of the oldest non-obsolete in the retention policy when the database is recovered.
2. If the archive file is obsolete, the archive files do not need to be applied to a full-database backup of the oldest non-obsolete in the backup retention policy during database recovery.
This article is from the "myblog" blog, please be sure to keep this source http://jiujian.blog.51cto.com/444665/1165766