Both the command is used to force
the log switch but they do it in different way. ARCHIVELOG CURRENT waits for
the writing to complete. This can take several minute to complete for large
redologs file where as SWITCH LOGFILE is fast as it does not wait for the
archiver process to complete writing the online redologs.
The ‘ARCHIVELOG CURRENT’ command is
safer because it waits for OS to acknowledge that the redolog has been
successfully written. Hence this command is best practice for production backup
script for RMAN.
The ‘ARCHIVELOG CURRENT’ allows, you
to specify the thread to archive (If you do not pass the thread parameter then
oracle will archive all full online redo logs) where as ‘SWITCH LOGFILE’
archives only the current thread.
Note: In case of RAC environment, the ‘ARCHIVELOG CURRENT’
will switch the log of all nodes (instances) where as ‘SWITCH LOGFILE’ will
only switch the log file on the instance where you issue this command.
SWITCH LOGFILE’ is not a
correct method after hot backup
In order to be sure that all changes
generated during a hot backup are available for a recovery, Oracle recommends
that the current online log be archived after the last tablespace in a hot
backup is taken out of backup mode. A similar recommendation stands for after a
recovery manager online database backup is taken.
Comments
Post a Comment