Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Oracle backup questions...

RE: Oracle backup questions...

From: Bobak, Mark <>
Date: Tue, 18 Sep 2007 16:42:53 -0400
Message-ID: <>

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 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

ProQuest...Start here.

-----Original Message-----

From: [] On Behalf Of Mason Loring Bliss Sent: Tuesday, September 18, 2007 3:04 PM To:
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        Oderint dum metuant!     awake ? sleep : random() & 2 ? dream : sleep;


-- Received on Tue Sep 18 2007 - 15:42:53 CDT

Original text of this message