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: Mark D Powell <mark.powell_at_eds.com>
Date: 28 Feb 2002 06:53:46 -0800
Message-ID: <178d2795.0202280653.348664b6@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 -- Received on Thu Feb 28 2002 - 08:53:46 CST

Original text of this message

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