Home » RDBMS Server » Backup & Recovery » rman backup doesn't become obsolete (10g,Solaris)
rman backup doesn't become obsolete [message #509615] Mon, 30 May 2011 09:31 Go to next message
valmar
Messages: 10
Registered: May 2011
Junior Member
Hello,
I have a policy running every night and it makes:
- level 0 for datafiles not backed up,
- level 1 for datafile not backed up since 'sysdate-1'
then another policy makes:
- level 0 when the datafiles become read only

The recovery windows is set to 1 day.

In the following situation:

RMAN> list backup of datafile 394;


List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12721 Incr 0 13.25M SBT_TAPE 00:01:13 25-MAY-11
BP Key: 12777 Status: AVAILABLE Compressed: NO Tag: ST_TRONLINE_FB20110525
Handle: bk_13201_1_752082473 Media: A00003
List of Datafiles in backup set 12721
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
394 0 Incr 79015872 25-MAY-11 /<pathname>/dfx.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15462 Incr 0 768.00K SBT_TAPE 00:01:01 27-MAY-11
BP Key: 15474 Status: AVAILABLE Compressed: NO Tag: ST_TRCONS_FB20110527
Handle: bk_13322_1_752218752 Media: A00003
List of Datafiles in backup set 15462
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
394 0 Incr 79174934 26-MAY-11 /<pathname>/dfx.dbf

I expect that the first L0 backup is going to become obsolete, but even if I run crosscheck, it never become obsolete.

Why this is happening ?
Thanks in advance for your answers.
Re: rman backup doesn't become obsolete [message #509619 is a reply to message #509615] Mon, 30 May 2011 10:21 Go to previous messageGo to next message
knight
Messages: 111
Registered: January 2009
Senior Member
Quote:
I have a policy running every night and it makes:

-can you post your RMAN script which you use
Re: rman backup doesn't become obsolete [message #509622 is a reply to message #509615] Mon, 30 May 2011 11:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please all relevant information: scripts, execution and so on.
do NOT just explain what yoy think you do or did.

Before, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decim

Regards
Michel
Re: rman backup doesn't become obsolete [message #509678 is a reply to message #509622] Tue, 31 May 2011 03:42 Go to previous messageGo to next message
valmar
Messages: 10
Registered: May 2011
Junior Member
Hello,
sorry for bothering you. I'll try again...
The oracle version we use is 10.2.0.3

The scripts we run are:

RUN {
   ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; 
   ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE'; 
   backup 
   TAG ST_TRONLINE_FB20110525 
   filesperset 20 
   incremental level=0 
   # recommended format
   FORMAT 'bk_%s_%p_%t' 
   datafile 
     < a list of datafile selected from dba_data_files view 
     where the related tablespace is 'ONLINE' >
   not backed up;
   CROSSCHECK BACKUPSET;
   CROSSCHECK ARCHIVELOG ALL;
   DELETE NOPROMPT EXPIRED BACKUP;
   DELETE NOPROMPT OBSOLETE;
   RELEASE CHANNEL ch00;
   RELEASE CHANNEL ch01;
   resync catalog;
}
RUN {
   ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; 
   ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE'; 
   backup 
   TAG ST_TRONLINE_FB20110525 
   filesperset 20 
   incremental level=1 
   # recommended format
   FORMAT 'bk_%s_%p_%t' 
   datafile
     < a list of datafile selected from dba_data_files view 
     where the related tablespace is 'ONLINE' > 
     not backed up since time 'sysdate-1';
   CROSSCHECK BACKUPSET;
   CROSSCHECK ARCHIVELOG ALL;
   DELETE NOPROMPT EXPIRED BACKUP;
   DELETE NOPROMPT OBSOLETE;
   RELEASE CHANNEL ch00;
   RELEASE CHANNEL ch01;
   resync catalog;
}
RUN {
   ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; 
   ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE'; 
   backup 
   TAG ST_TRCONS_FB20110527 
   filesperset 20 
   INCREMENTAL LEVEL=0
   # recommended format
   FORMAT 'bk_%s_%p_%t' 
   datafile 
     < list of datafile selected from RC_DATAFILE 
     where READ_ONLY=1 and they have not a level 0 backup
     since they were read only >;
   CROSSCHECK BACKUPSET;
   CROSSCHECK ARCHIVELOG ALL;
   DELETE NOPROMPT EXPIRED BACKUP;
   DELETE NOPROMPT OBSOLETE;
   RELEASE CHANNEL ch00;
   RELEASE CHANNEL ch01;
}


The policies run every night, every night some datafile are created new and other are set read only. The problem I have is
the following:

at day 1 /aaa/bbb.dbf is online
day 1 ---> L0
day 2 ---> L1
day 3 ---> L1
at day 4 /aaa/bbb.dbf is set read only
day 4 ---> L0

with a recovery window of 1 day, at day 5 should the backup of
day 1, day 2 and day 3 become obsolete ?


Here you are a real example:
List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12720   Incr 0  22.25M     SBT_TAPE    00:01:02     25-MAY-11      
        BP Key: 12776   Status: AVAILABLE  Compressed: NO  Tag: ST_TRONLINE_FB20110525
        Handle: bk_13200_1_752082447   Media: A00003
  List of Datafiles in backup set 12720
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  433  0  Incr 79015863   25-MAY-11 /aaa/bbb.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14258   Incr 1  5.00M      SBT_TAPE    00:01:03     27-MAY-11      
        BP Key: 14313   Status: AVAILABLE  Compressed: NO  Tag: ST_TRONLINE_FB20110527
        Handle: bk_13276_1_752214054   Media: A00003
  List of Datafiles in backup set 14258
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  433  1  Incr 79208569   27-MAY-11 /aaa/bbb.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
16240   Incr 1  256.00K    SBT_TAPE    00:01:06     29-MAY-11      
        BP Key: 17142   Status: AVAILABLE  Compressed: NO  Tag: ST_TRONLINE_FB20110529
        Handle: bk_13448_1_752388757   Media: A00003
  List of Datafiles in backup set 16240
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  433  1  Incr 79458305   29-MAY-11 /aaa/bbb.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21094   Incr 0  1.50M      SBT_TAPE    00:02:22     31-MAY-11      
        BP Key: 21106   Status: AVAILABLE  Compressed: NO  Tag: ST_TRCONS_FB20110531
        Handle: bk_14397_1_752564171   Media: A00003
  List of Datafiles in backup set 21094
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  433  0  Incr 79668075   30-MAY-11 /aaa/bbb.dbf


Re: rman backup doesn't become obsolete [message #509681 is a reply to message #509678] Tue, 31 May 2011 03:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
with a recovery window of 1 day, at day 5 should the backup of
day 1, day 2 and day 3 become obsolete ?

No, there are mandatory to restore the online files.

Regards
Michel
Re: rman backup doesn't become obsolete [message #509682 is a reply to message #509681] Tue, 31 May 2011 04:06 Go to previous messageGo to next message
valmar
Messages: 10
Registered: May 2011
Junior Member
Hello,
thanks for your answer. Would you mind explain me why they are mandatory to restore the online files ?
When they become obsolete ?

Thank you again and best regards
Valeria
Re: rman backup doesn't become obsolete [message #509683 is a reply to message #509682] Tue, 31 May 2011 04:36 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I think I misread your test case.
In day 5 it depends of the time you check the backup.
If it is more than 24 hours after the latest L0 backup then the previous ones are obsolete (regarding this file but they may contain other backups).

Regards
Michel
Re: rman backup doesn't become obsolete [message #509684 is a reply to message #509683] Tue, 31 May 2011 04:40 Go to previous messageGo to next message
valmar
Messages: 10
Registered: May 2011
Junior Member
The problem I noticed is that those backup never become obsolete (nor day 6 nor day 7).
May this behaviour be related to rman command '...not backed up..' ?

Looking forward to your answer
BR / Valeria
Re: rman backup doesn't become obsolete [message #509969 is a reply to message #509684] Wed, 01 June 2011 22:29 Go to previous messageGo to next message
hkchital
Messages: 128
Registered: September 2008
Location: Singapore
Senior Member
RETENTION POLICY applies to the *BACKUP SET*. You expect it to apply to individual datafiles within a backupset.

You have a backupset that contains a backup of, say , 4 files (fileids 3,4,5,6)
Say you change fileid 5 to readonly.
But fileids 3 4 and 6 are not changed.
Unfortunately, however, there is no new L0 backup since their first backup on day 1.
Therefore, the backupset that contains these datafile backups cannot be obsoleted.

Obsolescence applies to BackupSet, BackupPiece, ProxyCopy or Datafile copy.
You should either create separate BackupSets OR set FILESPERSET to 1 and have each of the datafiles (automatically) go to a separate backupset OR use datafile copy's.

Hemant K Chitale
Re: rman backup doesn't become obsolete [message #510292 is a reply to message #509969] Fri, 03 June 2011 08:01 Go to previous messageGo to next message
valmar
Messages: 10
Registered: May 2011
Junior Member
Thank you very much for you help, now I did understand what was the problem.
Br / Valeria
Re: rman backup doesn't become obsolete [message #510906 is a reply to message #510292] Wed, 08 June 2011 05:43 Go to previous message
techxpit
Messages: 1
Registered: June 2011
Location: San Francisco
Junior Member
I believe you may need to modify your backup script and split run in two different "run" statements. In the first "run command, do the backup only. For the backup see how channel is included INSIDE the run and is NAMED, like t1 or whatever.

Then do the second run statement for crosscheck and delete obsolete/expired. Very important, notice how Channel is assigned for MAINTENANCE, and is OUTSIDE the "run". For deleting/obsoleting backups, channel is required to be for Maintenance, may be thats why your backups are not getting deleted. <if a maintenance channel is included inside the "run", we get errors, so make sure for delete maintenance channel is outside the run statement>.

Also, I normally use "delete force noprompt" to make sure stuff gets deleted.



connect target / catalog rman10/rman10@Catdb
run
{
allocate Channnel t1 device type 'SBT_TAPE'
parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm//bin64/tdpo_mydb.opt)';
backup
incremental level 1 cumulative
database
.......
etc
release channel t1
}


allocate channel for maintenance type 'SBT_TAPE'
parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm//bin64/tdpo_mydb.opt)';
run
{
report obsolete;
CROSSCHECK BACKUP;
DELETE force noprompt EXPIRED BACKUP;
delete force noprompt obsolete;
}
release channel;

[Updated on: Wed, 08 June 2011 05:50]

Report message to a moderator

Previous Topic: Cloning
Next Topic: Filesperset behaviour
Goto Forum:
  


Current Time: Fri Mar 29 05:13:32 CDT 2024