This discussion is archived
8 Replies Latest reply: Jan 24, 2013 1:46 AM by nww RSS

deleting archive logs on primary only after they are backed up on standby

OrnaWeisman Newbie
Currently Being Moderated
Hi

I have a 11.2 primary and standby configuration ( MaxPerformance ).
I want to off load my full backups and archive log backups to the standby.

I need to make absolutely sure that the archive logs are not deleted from the primary site until they are backed up* to tape on the standby site.
configure deletion policy "to applied to all standby" is not good enough, because something can happen to the archive logs after they are applied but before they are backed up to tape n the standby.

What are my options ?

thanks
Orna
  • 1. Re: deleting archive logs on primary only after they are backed up on standby
    692730 Newbie
    Currently Being Moderated
    I have a similar setup. We perform backups on both the primary and standby.

    Both do full/incremental/crosscheck/archivelogs. They use same catalog, we just TAG the standby so we know what backupsets belong to what.

    To ensure we don't lose any logs we have the archivelog jobs scheduled just slightly scattered as far as the time frame.

    We use the following on the primary

    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY BACKED UP 1 TIMES TO 'SBT_TAPE';

    This ensures that the standby has the time to receive the log, apply it and then within 1 hour is backed up.
    This has worked for us very well.

    Ensure you have good monitoring setup with OEM or another tool.

    - Wilson
    www.michaelwilsondba.info
  • 2. Re: deleting archive logs on primary only after they are backed up on standby
    OrnaWeisman Newbie
    Currently Being Moderated
    thank you for your reply.

    My problem is that I do not want to backup the primary at all.
    two reasons :

    1. my backups generate a strain on the primary database
    2. we backup directly to tape and we are paying license fee for the Networker module.
    We do not want to spend 2 licenses - one for the primary and one for the standby.

    So the plan was to offload the backups to the standby and stop the backups on the primary altogather, thus releasing one license.
    But this makes me very nervous as I am never sure , when I am purging the archive logs on the primary , that they are already backed up by the standby...
  • 3. Re: deleting archive logs on primary only after they are backed up on standby
    692730 Newbie
    Currently Being Moderated
    Unfortunately without building lots of logic into scripts...I am not aware of any built-in feature or syntax that would do that for you.

    - Wilson
    www.michaelwilsondba.info
  • 4. Re: deleting archive logs on primary only after they are backed up on standby
    OrnaWeisman Newbie
    Currently Being Moderated
    I guess I can go to the RMAN , query it for the maximum number of archive log that was backed up and purge everything before it.
    its not too complicated, but I wish Oracle can add a 'deletion policy' that will account for that ( i.e - delete only what was backed up by ANY of the members of the configuration, be it primary or standby :- ) )
  • 5. Re: deleting archive logs on primary only after they are backed up on standby
    OrnaWeisman Newbie
    Currently Being Moderated
    Another question for you :

    If I understand correctly , the deletion policy on the standby site where the backups are taken needs to be set to NONE ( it should be applied to all standby on the primary which is OK ).

    However , let's say I have a couple hours delay, archive logs are accomulating on the standby but are not applied.
    I am running a backup and then deleting the backed up archive logs.
    whats to prevent RMAN to backup and delete those archive logs that are not yet applied ??

    I am asking because I am no busy resolving an archive gap on standby that I believe was a result of exactly that scenario..
    archive logs were transfered and waiting to apply , backup was running on the standby and deleting them and they were missing when it was their turn to be applied.

    thanks
    Orna
  • 6. Re: deleting archive logs on primary only after they are backed up on standby
    692730 Newbie
    Currently Being Moderated
    Orna Weisman wrote:
    whats to prevent RMAN to backup and delete those archive logs that are not yet applied ??
    You can adjust the deletion policy to say not to delete until after backed up 2 times.

    You could adjust the schedule of your archivelog backups.

    To resolve the gap you can perform the following:

    restore the "gap" archivelogs on the standby

              rman
              connect rcvcat rman/rman@rmancat
              connect target /
              configure retention policy to recovery window of XXX days;
         
              run {
              allocate channel t1 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/path/to/file/tdpo.opt)';
              restore archivelog from logseq=1234 until logseq=1240 thread=3;
              }

    This was assuming you are using tsm. If you are using legato

    allocate channel t1 type 'SBT_TAPE' parms 'ENV=(NSR_BINDIR=/usr/sbin,NSR_CLIENT=dbsvr01,NSR_SERVER=lgbk01,NSR_DATA_VOLUME_POOL=DATABASE)';

    Hope this helps

    - Wilson
    www.michaelwilsondba.info
  • 7. Re: deleting archive logs on primary only after they are backed up on standby
    OrnaWeisman Newbie
    Currently Being Moderated
    Oh, I resolved the gap, that was not a problem
    the archive logs where backed up before they were deleted.

    The problem was that they were deleted in the first place , before they were applied

    I would think that RMAN will provide a deletion policy for standby so that it will not delete archive logs on a standby node that were not yet applied.
    As it is , the deletion policy on the standby is NONE ( as recommended ) and the archive logs will be deleted.
    Unless I will develop a script that will figure out the last applied log and only delete those archive logs that were already applied.

    I was just thinking it would be nice to instruct RMAN to do it for me via a deletion policy of some sort :-)
  • 8. Re: deleting archive logs on primary only after they are backed up on standby
    nww Newbie
    Currently Being Moderated
    Hi,

    I have a question about handling the archivelog in primary. Sorry for bring up this old post.
    My question is "Do I need to periodically run RMAN on primary to backup and delete those archivelog in primary?" If yes, those archivelogs will be shown twice in the recovery catalog. And, I still need to run rman backup job in the primary. I am a bit puzzled.

    In Primary,
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

    In Standby,
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;

    Regards,
    nww

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points