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

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

From: Steven Verstrepen <sv2703[no.sp_at_m>
Date: Thu, 28 Feb 2002 10:23:22 +0100
Message-ID: <3c7df72d$0$7117$4d4efb8e@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 Received on Thu Feb 28 2002 - 03:23:22 CST

Original text of this message

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