Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: archive log curr v. switch logfile
The 'ALTER SYSTEM ARCHIVELOG CURRENT' is the preferred one that should be used for backup scripts.
The reason being, if you have noticed when you do an 'ALTER SYSTEM SWITCH LOGFILE', you get the prompt back immediately. This command performs a database checkpoint, switches to the next log, signals the archiver to copy the logfile to the archive destination, and returns the prompt. Mind you, this command does not wait for the archive to complete. As the command indicates, it only performs a log switch. Hence, you might come across backup scripts which does an 'ALTER SYSTEM SWITCH LOGFILE' and then does a SLEEP for some time, thus allocating some time for the Archiver to finish archiving. Whereas, an 'ALTER SYSTEM ARCHIVE LOG CURRENT' does all of the above, but does not return back to the prompt until the archive is complete.
Also, 'ALTER SYSTEM SWITCH LOGFILE' archives only the current thread. Whereas the 'ALTER SYSTEM ARCHIVELOG CURRENT' needs a thread to be specified and If you miss the thread parameter, Oracle archives all redo log file groups from all enabled threads, including logs previous to current logs.
Hope this helps.
Raj
"Baker, Barbara" <bbaker_at_denvernewspapera To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> gency.com> cc: Sent by: Subject: archive log curr v. switch logfile root_at_fatcity.com March 29, 2002 11:23 AM Please respond to ORACLE-L Can anyone tell me the difference between alter system archive log current and alter system switch logfile
(Seems they both perform checkpoint and both switch a log file).
Is one preferred over the other for purposes of switching log files prior
to
applying to a standby database?
Thanks for any insights.
Barb
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Rajesh.Rao_at_jpmchase.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- 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-LReceived on Fri Mar 29 2002 - 11:48:25 CST
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).