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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Why control files are needed for restore of hot backup?

Re: Why control files are needed for restore of hot backup?

From: Sean M <smckeownNO_at_BACKSIESearthlink.net>
Date: Wed, 22 May 2002 14:54:32 -0600
Message-ID: <3CEC0588.B1F94A00@BACKSIESearthlink.net>


Sybrand Bakker wrote:
>
> On 21 May 2002 17:48:29 -0700, danielroy10_at_hotmail.com (Daniel Roy)
> wrote:
>
> >Hi everyone,
> > I have a question which will probably look obvious to many, but I'm
> >just starting with Oracle! If I take a hot backup of a database, using
> >for each tablespace:
> >- alter tablespace bla-bla begin backup
> >- I copy the tablespace datafiles to the backup directory
> >- alter tablespace bla-bla end backup
> >
> >I also include in my backup the archive logs generated during the
> >backup.
> >Now my question is if the datafile structure of the database doesn't
> >change, do I really need the control file to also be backed up? It
> >seems to me that at recovery time, re-creating the control files
> >should be the same result than using a control file from during the
> >backup. My feeling is that in both cases, Oracle relies exclusively on
> >the SCN's of the datafile headers in order to decide which datafile
> >needs recovery, and which one doesn't.
> >
> >Daniel
>
> Study the difference between *complete* recovery (all files present)
> and *incomplete* recovery (backup controlfile) and don't try to be
> 'smart'. During *complete* recovery Oracle compares the SCNs in the
> controlfile and the datafiles.
 

I disagree. The act of recreating a controlfile does *not* always require an incomplete recovery. You can lose all copies of your controlfile, recreate it with the NORESETLOGS clause, and do a fully complete recovery (i.e. open the database without the 'resetlogs' clause, no loss of committed transactions). You'll need to have all archive logs since the last backup and all online redo logs up to the point of the media failure, of course.

[Think about it. You have a good backup of your db (hot/cold/whatever, as long as it's good). Say you loose a disk that contains all your controlfiles (dumb, but let's stick to the hypothetical) and, say, the USER_DATA tablespace. Everything else is OK. You restore the USER_DATA datafiles from the backup. You startup nomount, issue "create controlfile noresetlogs blah blah", then recover the database. Oracle applies all archives to USER_DATA since the backup, and then applies all online redo logs to USER_DATA and any other datafiles who need to be caught up. Next step is 'alter database open' (notice no resetlogs clause) and bingo, recovered database, no commited transactions lost, no resetlogs issued, and all with a new controlfile.]

Daniel's question is valid. The answer is that, no, you don't necessarily *have* to have a current copy of the controlfile to restore a backup. But since you multiplex your controlfiles (you do multiplex them, don't you?), this would rarely be necessary. Best advice - multiplex the controlfile, and make a backup controlfile to trace after every structural change to the db. It'll save your bacon.

Regards,
Sean Received on Wed May 22 2002 - 15:54:32 CDT

Original text of this message

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