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: resore a database at a specific daytime

Re: resore a database at a specific daytime

From: Howard J. Rogers <dba_at_hjrdba.com>
Date: Fri, 23 Nov 2001 05:48:16 +1100
Message-ID: <3bfd47ee$0$13481$afc38c87@news.optusnet.com.au>


When you perform incomplete recovery (ie, to a point in time short of where recovery would otherwise normally end), you restore *all* the datafiles from your cold backup *and nothing else*. If you restore the whole lot, including control files and online redo logs, then your database is totally consistent at the time of the last backup, and needs no recovery.

But by restoring just the data files, and not the control files or redo logs, there is a mis-match between the control file's SCN and that stored in the headers of the data files, and that mismatch will provoke Oracle into demanding recovery.

In short, there must be an inconsistency before recovery takes place, otherwise there is simply no need for recovery.

The section on restoring pre-resetlogs backups is (I presume, since I haven't actually seen it) talking about this scenario: you restore all data files, perform a successful incomplete recovery, and then (as you have to) perform an 'alter database open resetlogs'. Resetlogs effectively sets the time of your database back to 1 -at which point, prior backups taken at time 1789379 (say) are useless, and so are all your archives (because they relate to a database at time 1789379 too. You are therefore supposed to immediately shut your newly-recovered database down and perform a new, closed database backup -otherwise it is extremely vulnerable to failure. However, in a 24x7 environment, such a shutdown/backup is probably not an option -so the database sails on without any useful backup. The law of averages states that in this situation, and once in a blue moon, you are going to have another sort of failure (media failure, user error etc) before you finally get round to backing up the database. So what do you do? That's what the 'restoring pre-resetlogs backups' is all about... if you are very lucky and know exactly what you are doing, you can perform a new complete or incomplete recovery from the second failure despite you having performed a previous resetlogs. In all the courseware, they call this a "recovery through resetlogs". I prefer to call it a "recovery *despite* a resetlogs": you are able to use the pre-resetlogs backups and archives despite the fact that the resetlogs operation has rendered them otherwise useless.

It's tricky, has strict requirements before it can work, involves some deft copying and re-copying of the various control file versions - and if you do a backup after a resetlogs operation, you'll never need to perform it.

And none of that has anything to do with performing ordinary incomplete recoveries.

Regards
HJR

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


"Mark Bole" <makbo_at_ecis.com> wrote in message
news:3BFD07C0.E4BDBFE0_at_ecis.com...

> This is still very puzzling. There is a section in the "Oracle 8i Backup
and
> Recovery Guide" called "Restoring Pre-RESETLOGS Backups" that seems to
address
> this, but after studying this section several times, I still can't get it
to
> work (or just don't understand).
> To re-state the scenario,
>
> 1) shutdown normal
> 2) perform cold backup (copy all files)
> 3) startup again, normal archived redo logs are generated for some period
of
> time, say, one day.
> 4) now I want to restore the cold backup, and roll forward some of the
archived
> redo logs (up to some point in time).
>
> As the original poster said, Oracle doesn't want to, it states "no media
> recovery required". I want it to recover anyway. How?
>
> "Howard J. Rogers" wrote:
>
> > There's absolutely no reason to use 'backup controlfile' unless you are
> > actually restoring a binary version of the control file.
> >
> > A 'recover until time', as for any incomplete recovery, requires that
you
> > restore all data files, and do NOT resotre any of the online logs (which
> > shouldn't be being backed up anyway), nor the controlfile.
> >
> > If data files are restored, but not controlfiles, then there is an
> > inconsistency which *must* require recovery. Only if you are restoring
> > *everything* will you not be prompted for recovery. It is impossible,
if
> > you are doing everything correctly, NOT to be asked for logs to be
applied.
> >
> > Regards
> > HJR
> > --
> > Resources for Oracle: http://www.hjrdba.com
> > ===============================
> >
>
> [...]
>
Received on Thu Nov 22 2001 - 12:48:16 CST

Original text of this message

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