Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: switch logfile vs. archive log current

Re: switch logfile vs. archive log current

From: Hemant K Chitale <hkchital_at_singnet.com.sg>
Date: Thu, 20 Mar 2003 00:42:45 +0800
Message-Id: <24715.322391@fatcity.com>


A "switch logfile" isn't mandatory and an "archive log current" is highly recommended.
The "switch logfile" command would return immdiately and would not wait for the archiver to complete archiving the log. The "archive log current" would return only after the archiver has completed it's job. You must backup the archivelogs from the first one generated after the first "alter tablespace begin backup" to the first one after the last "alter tablespace end backup". You are also backing up the controlfile which is also highly recommended.

I normally use a combination of multiple "switch logfile", "archive log" commands and
a Unix "sleep" command and then exclude the last archivelog from the backup just to be safe.
Hemant
At 06:14 AM 19-03-03 -0800, you wrote:
>In my hot backup script, should I be using "alter system archive log
>current;"
>instead of "alter system switch logfile;"?
>
>At present this is what I am doing:
>
>For each tablespace:
>
>sqlplus internal << EOF
>alter tablespace ERGO_USR begin backup;
>exit
>EOF
>#
>cp $DIR3/ERGO_USR.dbf $BACKUP_DIR$DIR3
>#
>sqlplus internal << EOF
>alter tablespace ERGO_USR end backup;
>alter system switch logfile;
>exit
>EOF
>
>For the last tablespace:
>
>sqlplus internal << EOF
>alter tablespace USERS begin backup;
>exit
>EOF
>#
>cp $DIR1/users01.dbf $BACKUP_DIR$DIR1
>#
>sqlplus internal << EOF
>alter tablespace USERS end backup;
>alter database backup controlfile to '$BACKUP_DIR$DIR1/control01.bak';
>alter system switch logfile;
>exit
>EOF
>#
>
>Thanks,
>Peter Schauss
>Northrop Grumman Corporation
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.net
>--
>Author: Schauss, Peter
> INET: pschauss_at_northropgrumman.com
>
>Fat City Network Services -- 858-538-5051 http://www.fatcity.com
>San Diego, California -- Mailing list and web hosting services
>---------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).

Hemant K Chitale Received on Wed Mar 19 2003 - 10:42:45 CST

Original text of this message

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