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: Howard J. Rogers <dba_at_hjrdba.com>
Date: Fri, 1 Mar 2002 08:14:25 +1100
Message-ID: <a5m6jq$p7s$1@lust.ihug.co.nz>


Two things. It's utterly pointless taking the thing in and out of archivelog mode. What's the point? You're trying, I presume, to ensure that your archive sets are as up to date as they can possibly be. Why? What you don't backup today, you'll backup tomorrow.

Second, why on earth are you restoring controlfiles? There is only one reason to do that, and that's when the controlfile you've got doesn't describe the database structure you want. That's for things like dealing with a dropped tablespace, or perhaps dealing with tablespaces which the controlfile things are read-write but which you know to be read-only. Most unusual circumstances, in either case. All you need do is to restore the datafile(s) that is/are damaged, and issue a 'recover datafile X' command (or a recover database). It's almost certainly because of this backup controlfile issue that you are encountering weird issues with demands for ancient archives.

In any event, for standard recoveries, Oracle only needs to apply redo from the time the first of your tablespaces went into hot backup mode (ie., at the start of your backup cycle). Nevertheless, it pays to keep at least 2 or 3 days of archives available... I can show you posts from here where people have discovered that they've been backing up corrupt datafiles for a week, and need to restore from much further back than they ever anticipated.

You might want to check out my site, Books, Backup and Recovery. It covers all of this.

Regards
HJR

--
----------------------------------------------
Resources for Oracle: http://www.hjrdba.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
>
>
>
>
>
>
>
>
Received on Thu Feb 28 2002 - 15:14:25 CST

Original text of this message

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