Re: Oracle backup questions...

  • From: "Rajeev Prabhakar" <rprabha01@xxxxxxxxx>
  • To: mason@xxxxxxxxxxx
  • Date: Wed, 19 Sep 2007 06:29:58 -0400

Hello Mason

It appears that Mark has already answered your questions. I just wanted to
mention
that to be as close to the latest archive log to be included in the backup
set.
you should include the command "ALTER SYSTEM ARCHIVE LOG CURRENT"
twice (one in the beginning, other at the very end) in you procedure/script.
That
should take care of question 5 (i.e. archive logs as close as possible to
the most
current redo log ione).

So, here is the sequence (as far as addressing question 5 is concerned) :

1) alter system archive log current ;
2) select sequence# from v$log where status='CURRENT';
3) run your backup commands ...here..
4) alter system archive log current ;
5) backup all archive logs from seq# found at step 2 to the
   (sequence#-1) found at step 4 above.

Rajeev


On 9/18/07, Bobak, Mark <Mark.Bobak@xxxxxxxxxxxxxxx> wrote:
>
> Wow, lots of questions!
>
> Here we go.....
>
> 1.)  Are you mixing up archive log and on-line redo, here?  Online redo is
> written continuously, until full.  Then Oracle switches to the next redo
> log, and the previous one (that's just now full) will be archived.  The
> archiver process will copy the entire redo log to the archive log area.  So,
> the "on-disk state" of archivelogs is that the archive logs are complete and
> usable, with the possible exception of the last archive log, which may not
> have completed writing when the instance crashed.  That's ok, cause it's
> contents are still in the on-line redo.  Oracle guarantees that the on-line
> redo will not be overwritten until the redo is completely written to the
> archive log area.
>
> 2.)  Yes, there is.  When you do 'recover database', Oracle will read the
> SCNs the controlfile to "drive" the recovery.  It will use the data in the
> controlfiles to determine when recovery is complete.  In the case of
> 'recover database using backup controlfile', you're telling Oracle, this is
> a backup controlfile that I've restored, you can't rely on the SCNs it
> contains to be accurate.  Don't use them to drive the recovery.  In that
> event, Oracle will use the SCNs in the data file headers, and continue to
> roll forward till (at a minimum) they are self-consistent across all
> datafiles.  You'll need to give Oracle a point in time to recover to, or
> cancel the recovery, and open w/ resetlogs.  Note that if you have all the
> archive logs and on-line redo available, you can still do a complete
> recovery, but you'll need to manually apply the online redo once the last
> archive log is applied.
>
> 3.)  The crosscheck command, whether run on a backup or an archivelog,
> checks the RMAN repository against what's actually available on
> disk/tape.  Anything that no longer has media available, is updated in the
> RMAN repository to reflect that.
>
> 4.)  'delete expired' will remove from the RMAN repository, stuff that a
> previous crosscheck marked as expired cause media is no longer
> available.  'delete obsolete', on the other hand, deletes stuff that's not
> needed based on the retention policy you've set.  That's regardless of
> whether the media is still available.
>
> 5.)  Well, you can't control the rate of redo generation, which is a
> function of how busy your database is.  Archive log generation, then, will
> be a function of that rate of redo generation and the size of the archive
> log file.  What I like to do, is to look at the peak redo generation rate
> that my database sees, use that to size the online redo log (which
> implicitly sets the max size of an archive log), so that a log switch
> happens around every 20-30 minutes.  So, if you're generating 1GB of redo
> per hour, at peak, then size the on-line redo logs at around 333MB to
> 500MB.  That should give you, at peak, an archive log switch every 20-30
> mintes.  Now, what about non-peak?  Well, suppose you have non-peak times
> where you'll only generate 100MB per hour.  In that case, you'd be waiting
> 10 hours between log switches.  So, you can set a parameter called
> "ARCHIVE_LAG_TARGET", and that will force a which every x minutes.  You
> could set it to 30 minutes, and it will faithfully do a
> log switch every 30 minutes, even if the resulting archive log is only a
> few MB in size.
>
> Hope that helps,
>
> And I hope I got it all right.....
>
> -Mark
> --
> Mark J. Bobak
> Senior Database Administrator, System & Product Technologies
> ProQuest
> 789 E. Eisenhower, Parkway, P.O. Box 1346
> Ann Arbor MI 48106-1346
> +1.734.997.4059 or +1.800.521.0600 x 4059
> mark.bobak@xxxxxxxxxxxxxxx
> www.proquest.com
> www.csa.com
>
>
> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
> On Behalf Of Mason Loring Bliss
> Sent: Tuesday, September 18, 2007 3:04 PM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: Oracle backup questions...
>
> I'm working on Oracle back-up and recovery, and I've run across a few
> random
> questions from looking at what other folks do, and from experimenting on
> my
> own.
>
> 1. What is the on-disk state of archive logs at arbitrary times? Does
> Oracle
> only write them out when they are complete and usable, or does it slowly
> fill
> them in over time? Recovering the final archive log here seems to
> consistently fail, until the next archive log is in place, at which time
> the
> one that was previously last is imported without issue.
>
> 2. Is there any meaningful difference between "recover database" and
> "recover
> database using backup controlfile"?
>
> 3. What is "crosscheck archivelog all" as opposed to "crosscheck backup"?
>
> 4. How does "delete obsolete" differ from "delete expired backup"?
>
> 5. How do we control the frequency of archive log generation? Do I simply
> say
> "alter system switch logfile" and wait a bit, or does that only affect
> redo
> logs? Should I "alter system archive log all" instead? In short, what
> should
> I do to try to bring the archive logs as close to current as is possible?
>
> Thanks very much for your help!
>
> --
> Mason Loring Bliss      mason@xxxxxxxxxxx        Oderint dum metuant!
> http://blisses.org/     awake ? sleep : random() & 2 ? dream : sleep;
> --
>

Other related posts: