xoxomos
asked on
RMAN Retention Policy Question
I've got a retention policy of redundancy 1
When i report obsolete I see backup from March 24 included, but there are backups from March 23 that do not appear.
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
-------------------- ------ ------------------ --------------------
Archive Log 81951 24-MAR-10 /u04/archived_logs/1_48669 _665266938 .arc
Archive Log 81950 24-MAR-10 /u03/archived_logs/1_48669 _665266938 .arc
Archive Log 81955 24-MAR-10 /u04/archived_logs/1_48670 _665266938 .arc
Archive Log 81954 24-MAR-10 /u03/archived_logs/1_48670 _665266938 .arc
Archive Log 81958 24-MAR-10 /u04/archived_logs/1_48671 _665266938 .arc
Archive Log 81957 24-MAR-10 /u03/archived_logs/1_48671 _665266938 .arc
Why is RMAN not seeing backups from March 23 as obsolete?
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
592 Full 215.81G DISK 00:55:23 23-MAR-10
BP Key: 592 Status: AVAILABLE Compressed: NO Tag: BACKUP_BB60.CSUHAY_0323101 10002
Piece Name: /u05/rman/PRIMARY/backupse t/2010_03_ 23/o1_mf_n csdf_BACKU P_BB60.CSU HAY_0_5tmb mp3p_.bkp
Control File Included: Ckp SCN: 3372023929218 Ckp time: 23-MAR-10
SPFILE Included: Modification time: 11-FEB-10
List of Datafiles in backup set 592
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/system0 1.dbf
2 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/tools01 .dbf
4 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/undo01. dbf
5 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/users01 .dbf
When i report obsolete I see backup from March 24 included, but there are backups from March 23 that do not appear.
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
-------------------- ------ ------------------ --------------------
Archive Log 81951 24-MAR-10 /u04/archived_logs/1_48669
Archive Log 81950 24-MAR-10 /u03/archived_logs/1_48669
Archive Log 81955 24-MAR-10 /u04/archived_logs/1_48670
Archive Log 81954 24-MAR-10 /u03/archived_logs/1_48670
Archive Log 81958 24-MAR-10 /u04/archived_logs/1_48671
Archive Log 81957 24-MAR-10 /u03/archived_logs/1_48671
Why is RMAN not seeing backups from March 23 as obsolete?
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
592 Full 215.81G DISK 00:55:23 23-MAR-10
BP Key: 592 Status: AVAILABLE Compressed: NO Tag: BACKUP_BB60.CSUHAY_0323101
Piece Name: /u05/rman/PRIMARY/backupse
Control File Included: Ckp SCN: 3372023929218 Ckp time: 23-MAR-10
SPFILE Included: Modification time: 11-FEB-10
List of Datafiles in backup set 592
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
2 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
4 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
5 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
ASKER
When I list backup it shows a full backup on March 23 and March 24.
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
592 Full 215.81G DISK 00:55:23 23-MAR-10
BP Key: 592 Status: AVAILABLE Compressed: NO Tag: BACKUP_BB60.CSUHAY_0323101 10002
Piece Name: /u05/rman/PRIMARY/backupse t/2010_03_ 23/o1_mf_n csdf_BACKU P_BB60.CSU HAY_0_5tmb mp3p_.bkp
Control File Included: Ckp SCN: 3372023929218 Ckp time: 23-MAR-10
SPFILE Included: Modification time: 11-FEB-10
List of Datafiles in backup set 592
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/system0 1.dbf
2 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/tools01 .dbf
4 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/undo01. dbf
5 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/users01 .dbf
6 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/indx01. dbf
7 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/bbadmin _data_file 1.dbf
8 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB 60/bbadmin _indx_file 1.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
595 Full 215.82G DISK 00:50:23 24-MAR-10
BP Key: 595 Status: AVAILABLE Compressed: NO Tag: BACKUP_BB60.CSUHAY_0324101 10004
Piece Name: /u05/rman/PRIMARY/backupse t/2010_03_ 24/o1_mf_n cndf_BACKU P_BB60.CSU HAY_0_5toy zrxw_.bkp
Control File Included: Ckp SCN: 3372111031563 Ckp time: 24-MAR-10
List of Datafiles in backup set 595
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB 60/system0 1.dbf
2 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB 60/tools01 .dbf
3 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB 60/bb_bb60 _data_file 4.dbf
4 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB 60/undo01. dbf
5 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB 60/users01 .dbf
6 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB 60/indx01. dbf
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
592 Full 215.81G DISK 00:55:23 23-MAR-10
BP Key: 592 Status: AVAILABLE Compressed: NO Tag: BACKUP_BB60.CSUHAY_0323101
Piece Name: /u05/rman/PRIMARY/backupse
Control File Included: Ckp SCN: 3372023929218 Ckp time: 23-MAR-10
SPFILE Included: Modification time: 11-FEB-10
List of Datafiles in backup set 592
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
2 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
4 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
5 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
6 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
7 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
8 Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
595 Full 215.82G DISK 00:50:23 24-MAR-10
BP Key: 595 Status: AVAILABLE Compressed: NO Tag: BACKUP_BB60.CSUHAY_0324101
Piece Name: /u05/rman/PRIMARY/backupse
Control File Included: Ckp SCN: 3372111031563 Ckp time: 24-MAR-10
List of Datafiles in backup set 595
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB
2 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB
3 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB
4 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB
5 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB
6 Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB
Maybe that was a cut and paste error, but your Mar 24 backup does not list datafiles 7 or 8.
ASKER
True, I just did not want to paste the entire list.
The simple answer is, they are still there because you didn't delete them.
My routine is to have the following 3 steps at the beginning of the normal RMAN script to clean out backups past the retention interval, and also clean up files or tapes that have disappeared outside RMAN's control, such as may happen if archive log directories fill up and get compressed or moved around to free space.
delete noprompt force obsolete;
crosscheck backup;
delete noprompt force expired;
In your case you should get what you want if after you take your backup you "delete noprompt force obsolete", then the previous day's backup should be removed after the current day's backup is successful.
My routine is to have the following 3 steps at the beginning of the normal RMAN script to clean out backups past the retention interval, and also clean up files or tapes that have disappeared outside RMAN's control, such as may happen if archive log directories fill up and get compressed or moved around to free space.
delete noprompt force obsolete;
crosscheck backup;
delete noprompt force expired;
In your case you should get what you want if after you take your backup you "delete noprompt force obsolete", then the previous day's backup should be removed after the current day's backup is successful.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, tomcatkey, my script is exactly the same, maybe minus the 'force'.
I manually deleted them through RMAN. The system was shut down that evening exactly the time the backup finished and i'm wondering if that last step really got executed. The log stated so
I manually deleted them through RMAN. The system was shut down that evening exactly the time the backup finished and i'm wondering if that last step really got executed. The log stated so
ASKER
Script generated and executed by dbconsole:
executing command: SET COMMAND ID
backup device type disk tag 'BACKUP_BB60.CSUHAY_032810
Starting backup at 28-MAR-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1515 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
including current control file in backupset
input datafile fno=00012 name=/u02/app/oracle/orada
input datafile fno=00043 name=/u02/app/oracle/orada
.
.
.
.
.
input datafile fno=00008 name=/u02/app/oracle/orada
channel ORA_DISK_1: starting piece 1 at 28-MAR-10
channel ORA_DISK_1: finished piece 1 at 28-MAR-10
piece handle=/u05/rman/PRIMARY/b
channel ORA_DISK_1: backup set complete, elapsed time: 00:52:10
Finished backup at 28-MAR-10
backup device type disk tag 'BACKUP_BB60.CSUHAY_032810
Starting backup at 28-MAR-10
current log archived
using channel ORA_DISK_1
skipping archive log file /u03/archived_logs/1_48902
skipping archive log file /u04/archived_logs/1_48902
skipping archive log file /u03/archived_logs/1_48910
.
.
.
skipping archive log file /u03/archived_logs/1_48912
skipping archive log file /u04/archived_logs/1_48912
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=48913 recid=82683 stamp=714795251
input archive log thread=1 sequence=48914 recid=82686 stamp=714798821
.
.
.
.
input archive log thread=1 sequence=48995 recid=82928 stamp=714869701
input archive log thread=1 sequence=48996 recid=82932 stamp=714870953
input archive log thread=1 sequence=48997 recid=82935 stamp=714872749
input archive log thread=1 sequence=48998 recid=82937 stamp=714873162
channel ORA_DISK_1: starting piece 1 at 28-MAR-10
channel ORA_DISK_1: finished piece 1 at 28-MAR-10
piece handle=/u05/rman/PRIMARY/b
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56
Finished backup at 28-MAR-10
allocate channel for maintenance type disk;
released channel: ORA_DISK_1
allocated channel: ORA_MAINT_DISK_1
channel ORA_MAINT_DISK_1: sid=1515 devtype=DISK
delete noprompt obsolete device type disk;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 82651 27-MAR-10 /u04/archived_logs/1_48902
Archive Log 82650 27-MAR-10 /u03/archived_logs/1_48902
Archive Log 82653 27-MAR-10 /u03/archived_logs/1_48903
Archive Log 82654 27-MAR-10 /u04/archived_logs/1_48903
ASKER
Yes i see you're right there. Still i wonder how that happened. Any ideas?
Why would it be obsolete as it seems that it is the last backup for those datafiles ?
Those from 24 march are different files (archive logs) from the 23 march backup.
Regards,
Franck.