Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Backup procedures using Archive Log files.
Wayne Linton wrote:
>
> Sunil Gupta wrote:
> >
> > Hi There,
> > Could some body list the procedure (steps)
> > for backing up database using Archive log files.
> > I am running my database in Archive Mode and it generated a log file
> > at specified location. Since I have not tried a backup using Archive
> > log files, Some one with experience with procedures could help.
[ snip ]
> now when it is all done, alter system switch logfile, wait for it to
> be written to the archive disk, then do a file backup of all the archive
> log files.
[ snip ]
The 'wait for it to be written to archive disk' bit is tricky. It seems to be a little known fact that ALTER SYSTEM ARCHIVE LOG CURRENT switches the logs *and* waits for the log which was current to be archived. It is thus preferable to ALTER SYSTEM SWITCH LOGFILE when taking a backup.
Note, ALTER SYSTEM ARCHIVE LOG CURRENT did not exist in Oracle 6. In those bad old days, ALTER SYSTEM SWITCH LOGFILE followed by a bit of a wait was the best you could do.
My server is single threaded. In such a server, SELECT MAX(SEQUENCE#) FROM V$LOG will tell you the current log number. If this gives N before the backup starts, and M after the ALTER SYSTEM ARCHIVE LOG CURRENT, then the archive logs you need to store with the backup are numbers N to M-1 inclusive. These are exactly the ones which will be needed to roll the restored backup forward to the checkpoint which the ALTER SYSTEM ARCHIVE LOG CURRENT took.
For a multi-threaded server, you have to do this calculation for each thread. Received on Wed Dec 18 1996 - 00:00:00 CST
![]() |
![]() |