Can anyone tell me the difference between ALTER SYSTEM ARCHIVE LOG CURRENT and ALTER SYSTEM SWITCH LOGFILE ?
I do know the following
---------------------------
ALTER SYSTEM ARCHIVE LOG CURRENT does an implicit log switch and then archives current the log file.
ALTER SYSTEM SWITCH LOG FILE does an explicit log switch and that causes an archive log to be generated.
Am I right? if yes, Why do we need two commands to do the same work? Otherwise please correct me.
Hello;
The different between both is, that at the end of executing the SQL
in ALTER SYSTEM ARCHIVE LOG CURRENT
the LOG is archived!
but with ALTER SYSTEM SWITCH LOG FILE
the Log is ONLY READY for Archiving !!!
( Archiver will archive it when HE HAS TIME TO DO THIS ); There is no garantee that the log is archived immediatly.
I think ALTER SYSTEM ARCHIVE LOG CURRENT
is very importing for backup-routines
Does it mean that
When you issue ALTER SYSTEM ARCHIVE LOG CURRENT, Oracle Archives the log file and then switch log file?
and When you issue ALTER SYSTEM SWITCH LOG FILE, Oracle does a log switch first and then Archive it whenever ARCH has time to dio it.
No, before archiving a log, it must be switched!( finished in writing log )
For Backup you need the current log after ending backup the datafiles, because there are the last changes for the db in it which belongs to the backup;
If the Cuurent -Clause would not exist then a backup-procedure what never know having the last changes in Archived dest.
After finishing backup the datafiles the archive-dest is backuped and deleteted till the current archived log;
so when you need to media-recover a datafile you restore it and due to the archived-log you bring it to the level which was after the backup;
To understand more of backup and recovery and the concepts behind read the Oracle Database Concepts, it explains the concepts of the database;
You can not do ALTER SYSTEM ARCHIVE LOG CURRENT in a NOARCHIVELOG database, so if you must switch the log you can only do ALTER SYSTEM SWITCH LOG FILE.
Bookmarks