Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: quick hot backup question...

Re: quick hot backup question...

From: Howard J. Rogers <dba_at_hjrdba.com>
Date: Wed, 27 Mar 2002 17:38:36 +1100
Message-ID: <a7rpfh$p5$1@lust.ihug.co.nz>


Comments embedded.
HJR

--
------------------------------------------
Resources for Oracle : www.hjrdba.com
============================

"Ganesh Raja" <ganesh_at_gtfs-gulf.com> wrote in message
news:a8aed4.0203262202.7123b846_at_posting.google.com...

> Howard,
>
> A Question on The same lines...
>
> Is it really mandatory that you do Alter system Archive Log Current or
> Alter System Switch Logfile after the End Backup Command or after the
> entire script is done ?
>
It's not mandatory, no. The reason they recommend that you force a checkpoint (which either of those commands will do) is that until a new checkpoint is issued, the SCN in the header of the datafile(s) just come out of hot backup mode is still behind that of the rest of the database (having been locked that way by the begin backup command). If you were then to have an Instance failure, the database would not be openable, because not all datafiles appear synchronised when SMON checks the file headers at startup time. Now, if the failure had happened *during* the hot backup, you also wouldn't be allowed to open the database -but you could fix that up with a quick 'alter database datafile X end backup'. In this scenario, that won't work because the thing's already come *out* of hot backup mode. You would therefore be forced to perform media recovery (as well as the Instance recovery of course) -which isn't necessarily a pain, but since it's totally unnecessary, it just makes getting the Instance up and running longer than it should do. Personally, with redundant power supplies and UPSes, and a half-decent operating system(!), I think the chances of an Instance failure remote enough that I never issue the recommended log switch. Another checkpoint will come along soon enough anyway, and I'd rather not be issuing extra checkpoints of my own.
> Yeah i know that u need to take a Backup of the Log that Has the Alter
> Tablespace End Backup command. I am doing that now in all my backup
> scripts but my feelings is that it is not mandatory that it be done.
> Am i right ???
>
> I Feel that if u dont have the End Backup Command archived and all
> your redo and archives after the Backup got thrashed you can say
> <<Alter database Datafile <filename> end backup>>. So it does not make
> any difference you have the logs or not. Anyways u have lost your data
> and u just need to move the datafile back out of the backup mode and
> anyways you will be saying open resetlogs.
>
> Am i right in this assumption.
>
I think so, but I can't be sure as I got a bit lost with what scenario you were thinking of towards the end there! If you've lost redo and archives after the time of the backup, then yes, you're looking at an incomplete recovery, and that will require a resetlogs. But the recommended log switch/checkpoint after the 'end backup' command really has nothing to do with getting the 'End Backup' command archived, since it's not a piece of DML and doesn't get into the redo stream in the first place. What begin and end backup do is to set or reset a bit in the Control File which tells the Checkpoint Process not to update the header of the datafiles associated with that tablespace. It's SMON stumbling across a very old SCN in one datafile's header on Instance startup that prompts the demand for media recovery -even though *we* know that the contents of the file are bang up to date and require no such recovery, and that it's just the header SCN that's artificially wrong. So no, it's not mandatory, and I never bother with it. But for the sake of quick Instance startup and minimal fiddling around with the database unavailable, yes, it's probably sensible. Regards HJR
> Your comments on this are valuable.
>
> Thanks.
>
> Best Regards,
> Ganesh R
>
> "Glen A Stromquist" <gstromquist_at_nospamyahoo.com> wrote in message
news:<FpNn8.17155$mR1.434250_at_news2.telusplanet.net>...
> > Thanks Howard
> >
> > The reason for all this was I am just brushing up for an exam (finally)
and
> > the oracle tutorial I was running through said that a logfile switch
and
> > forced checkpoint should be done before a hot backup. I was pretty sure
the
> > checkpoint was done when the file was put in backup mode, but you
confirmed
> > it.
> >
> > I've had this discussion with you before regarding doing a log switch
after
> > the datafiles are copied then copying the archive log generated during
the
> > backup, and in the past went to great pains writing my script to do just
> > that. However after I "restored" a database to another location (clone)
from
> > a set of hotbackup files and applied all the archive logs to it, I
realized
> > that what I was doing was ok, but not really necessary, like you said.
> >
> > End result is that I don't bother anymore, and writing the dynamic
backup
> > scripts is a whole lot easier.
> >
> >
> > "Howard J. Rogers" <dba_at_hjrdba.com> wrote in message
> > news:a7o4ju$vfn$1_at_lust.ihug.co.nz...
> > > If you're doing O/S online backups, then there's no need for a
preliminary
> > > checkpoint, because that's precisely what the 'begin backup' command
> > forces
> > > (at least for the datafiles of the tablespace involved).
> > >
> > > The one about a preliminary log switch (presumably because you are
about
> > to
> > > copy the archives) is always a curious one. Lots of people do it, and
> > I've
> > > never really understood why. Usually the justification is that
without
> > it,
> > > you are short of the current redo log, so you may lose data. There's
> > > something to that, I suppose. But it's also usually (so I find)
because
> > > people view a backup as an isolated event, whereas the truth of the
matter
> > > is, of course, that what you don't backup tonight you will backup
> > tomorrow.
> > > So if there's a bit of current redo left unbacked up, who cares??
You'll
> > > get it when tomorrow's backup is performed, and in the meantime
there's no
> > > possible risk of data loss because you've multiplexed your online redo
> > logs,
> > > and then mirrored them with hardware RAID. Haven't you?? ;-)
> > >
> > > The other thing that mystifies me about forcing a log switch in order
to
> > get
> > > an archive of the current log is that it only makes another log the
> > current
> > > log. So you can *never* really be completely and utterly up-to-date
with
> > > redo copies, unless you stop all your users doing things: there'll
always
> > be
> > > a new piece of current redo which you haven't backed up today. Hence
cold
> > > backups, of course.
> > >
> > > That said, a log switch does no real harm -except induce a
> > > performance-hitting checkpoint.
> > >
> > > Regards
> > > HJR
> > > --
> > > ------------------------------------------
> > > Resources for Oracle : www.hjrdba.com
> > > ============================
> > >
> > > "Glen A Stromquist" <gstromquist_at_nospamyahoo.com> wrote in message
> > > news:jpMn8.11561$EV.366849_at_news1.telusplanet.net...
> > > > In my online backup scripts I don't do a logfile switch or force a
> > > > checkpoint before copying the datafiles.
> > > >
> > > > Is this recommended by Oracle?
> > > >
> > > > I'm wondering if I overlooked something when writing my scripts, I
have
> > used
> > > > my online backups on occasion to create a clone db, so I know they
> > "work"
> > > > the way I'm doing it now, but I guess it can't hurt to build in a
> > logfile
> > > > switch and/or force a checkpoint as part of the script as well.
> > > >
> > > > Curious to hear what others do regarding this....
> > > >
> > > >
> > > > cheers!
> > > >
> > > >
> > >
> > >
Received on Wed Mar 27 2002 - 00:38:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US