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: Backup toubles: How and when can I delete my archive logs?

Re: Backup toubles: How and when can I delete my archive logs?

From: Steven Verstrepen <sv2703[no.sp_at_m>
Date: Thu, 28 Feb 2002 17:48:47 +0100
Message-ID: <3c7e5f92$0$7110$4d4efb8e@news.be.uu.net>

"Mark D Powell" <mark.powell_at_eds.com> wrote in message news:178d2795.0202280653.348664b6_at_posting.google.com... > "Steven Verstrepen" <sv2703[no.sp_at_m]hotmail.com> wrote in message news:<3c7df72d$0$7117$4d4efb8e_at_news.be.uu.net>...
> > Hi,
> >
> > I'm currently learning how to make hot backups in Oracle 8 (NT
platform). My
> > database is running in ARCHIVELOG mode. I have created a script that
does
> > the following things:
> >
> > 1. Backup the table spaces:
> > Alter tablespace SYSTEM begin backup ;
> > !copy D:\ORANT\DATABASE\SYS1ORCL.ORA
D:\BACKUP\DATA\SYS1ORCL.BCK
> > alter tablespace SYSTEM end backup ;
> > (and the other table spaces ...)
> > 2. Stop the archive logging
> > alter system switch logfile ;
> > Archive log stop ;
> > 3. Copy the archive logs to a safe location
> > Copy D:\ORANT\DATABASE\ARCHIVE\ORCL*.ARC D:\BACKUP\DATA
> > 4. Delete the archive logs
> > Del D:\ORANT\DATABASE\ARCHIVE\ORCL*.ARC
> > 5. Restart the archive logging
> > Archive log start ;
> > 6. Backup the control file
> > Alter database backup controlfile to
> > 'D:\Backup\data\controlfile.bck' ;
> >
> > Things go wrong when I try to do a restore. As you can see, I delete all
old
> > archive logs everytime I run the script, after the backup of the
database is
> > made. That's the problem: when I restore the database files and the
control
> > file to the original locations, and I do a "recover database using
backup
> > controlfile", the svrmgr asks for archive log files that were already
> > deleted a long time a go. It even goes back to the time I have started
the
> > ARCHIVELOG mode!
> >
> > I assumed that Oracle would know that the old archive logs are not
needed
> > anymore when a new backup is made (when I make a new backup on day 2,
the
> > archive logs of day 1 are not needed anymore because all transactions
are
> > already in the database backup of day 2). This is obviously a wrong
> > assumption.
> >
> > What should I do to make it work? Is there a way to synchronize the
archive
> > logs with the contents of the database/the last backup? I suppose you
don't
> > have to keep all the archive logs forever.
> >
> >
> > Thanks for your suggestions!
> >
> > Steven

>
> Steven, you are making a hot backup and all archive logs created
> during the hot backyup are necessary to be applied to ensure it is
> consistent.  When you perform recovery you will need all archive logs
> that match your hot backup set plus Oracle will want all the logs made
> after the backup to the current time in order to perform forward
> recovery.
>
> It you do not want to forward recover until the time of failure then
> you have to perform a point in time recovery.  Unless you have lost
> all your current control files you should not recover it but rather
> run the recovery using the current control file, otherwise, be sure to
> remember to tell Oracle you are running the recovery "using backup
> controlfile".
>
> There are many options to recovery depending on what you want to
> recover.  For the most part you Oracle will recover itself if you copy
> the backup database files into the proper location, restore the
> archive logs, and point Oracle to their location.  You still need the
> prior backed up archive logs when you make a new backup depending on
> how secure you want your system to be.  There is alwyas a possibility
> your last backup is not good and you have to recover from the prior
> set.
>
> Depending on what kind of recovery test you were running and you tried
> to do a full recovery or a point in time Oracle may just want one
> older or newer archive log than you were expecting.  Though it does
> appear that you were not expecting to apply any to a hot backup set
> and that would be a wrong expectation.
>
> HTH -- Mark D Powell --

Thanks for your answer!

I understand I must keep at least all archive log files since my last hot backup (and even more, to have a more secure system). What I don't understand is why Oracle asks for the archive logs of two weeks ago, while I have restored yesterday's backup set. Everyday I make a new full hot backup, so every day I have a new copy of the whole databases. So am I wrong if I assume that, if my hot backup of today was succesful, I can safely delete the archive logs that were created before today's backup? So why do I need those older archive log files again when I am restoring the newer backup set? Oracle asks for archive logs of two weeks ago. In the meantime, I have made many succesful full hot backups, so why does it ask for archive logs whose transactions are already backed up multiple times in the database files themselves? I understand I need the archive logs to do a roll forward since my last successful backup, but why does oracle want to go back weeks *before* this last successful backup?

Steven Received on Thu Feb 28 2002 - 10:48:47 CST

Original text of this message

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