Link to home
Start Free TrialLog in
Avatar of xoxomos
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_032310110002
        Piece Name: /u05/rman/PRIMARY/backupset/2010_03_23/o1_mf_ncsdf_BACKUP_BB60.CSUHAY_0_5tmbmp3p_.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/BB60/system01.dbf
  2       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/tools01.dbf
  4       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/undo01.dbf
  5       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/users01.dbf
Avatar of Franck Pachot
Franck Pachot
Flag of Switzerland image

Hi,
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.
Avatar of xoxomos
xoxomos

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_032310110002
        Piece Name: /u05/rman/PRIMARY/backupset/2010_03_23/o1_mf_ncsdf_BACKUP_BB60.CSUHAY_0_5tmbmp3p_.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/BB60/system01.dbf
  2       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/tools01.dbf
  4       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/undo01.dbf
  5       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/users01.dbf
  6       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/indx01.dbf
  7       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/bbadmin_data_file1.dbf
  8       Full 3372023929269 23-MAR-10 /u02/app/oracle/oradata/BB60/bbadmin_indx_file1.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_032410110004
        Piece Name: /u05/rman/PRIMARY/backupset/2010_03_24/o1_mf_ncndf_BACKUP_BB60.CSUHAY_0_5toyzrxw_.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/BB60/system01.dbf
  2       Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB60/tools01.dbf
  3       Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB60/bb_bb60_data_file4.dbf
  4       Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB60/undo01.dbf
  5       Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB60/users01.dbf
  6       Full 3372111031696 24-MAR-10 /u02/app/oracle/oradata/BB60/indx01.dbf





Maybe that was a cut and paste error, but your Mar 24 backup does not list datafiles 7 or 8.
Avatar of xoxomos

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.
ASKER CERTIFIED SOLUTION
Avatar of vishal68
vishal68
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xoxomos

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
Avatar of xoxomos

ASKER


Script generated and executed by dbconsole:

executing command: SET COMMAND ID


 
backup device type disk tag 'BACKUP_BB60.CSUHAY_032810110007' da
 
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/oradata/BB60/bb_bb60_indx_file1.dbf
input datafile fno=00043 name=/u02/app/oracle/oradata/BB60/bb_bb60_stats_indx_file3.dbf
.
.
.
.
.

input datafile fno=00008 name=/u02/app/oracle/oradata/BB60/bbadmin_indx_file1.dbf
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/backupset/2010_03_28/o1_mf_ncsdf_BACKUP_BB60.CSUHAY_0_5v0jhssf_.bkp tag=BACKUP_BB60.CSUHAY_032810
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_032810110007' ar
 
Starting backup at 28-MAR-10
current log archived
using channel ORA_DISK_1
skipping archive log file /u03/archived_logs/1_48902_665266938.arc; already backed on 28-MAR-10
skipping archive log file /u04/archived_logs/1_48902_665266938.arc; already backed on 28-MAR-10
skipping archive log file /u03/archived_logs/1_48910_665266938.arc; already backed on 28-MAR-10
.
.
.
skipping archive log file /u03/archived_logs/1_48912_665266938.arc; already backed on 28-MAR-10
skipping archive log file /u04/archived_logs/1_48912_665266938.arc; already backed on 28-MAR-10
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/backupset/2010_03_28/o1_mf_annnn_BACKUP_BB60.CSUHAY_0_5v0mmohr_.bkp tag=BACKUP_BB60.CSUHAY_032810
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_665266938.arc
Archive Log          82650  27-MAR-10          /u03/archived_logs/1_48902_665266938.arc
Archive Log          82653  27-MAR-10          /u03/archived_logs/1_48903_665266938.arc
Archive Log          82654  27-MAR-10          /u04/archived_logs/1_48903_665266938.arc
Avatar of xoxomos

ASKER

Yes i see you're right there.  Still i wonder how that happened.  Any ideas?