Archive log and Log Switch
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: Archive log and Log Switch

Hybrid View

  1. #1
    Join Date
    Jun 2002
    Posts
    64
    Hi,

    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.


    Thanks
    Najmal Poolakkal

  2. #2
    Join Date
    Apr 2002
    Location
    Germany.Laudenbach
    Posts
    448
    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

    Orca

  3. #3
    Join Date
    Jun 2002
    Posts
    64
    Hi,

    Thanks!

    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.


    Rgds
    Najmal




  4. #4
    Join Date
    Apr 2002
    Location
    Germany.Laudenbach
    Posts
    448
    Hello;

    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;


    Orca

    [Edited by Orca777 on 06-13-2002 at 02:24 AM]

  5. #5
    Join Date
    Jun 2002
    Posts
    64
    Hi ,

    Is it right if I put it like this?

    ALTER SYSTEM ARCHIVE LOG CURRENT does a log swith and then ARCH immediatly archives it.

    And, ALTER SYSTEM SWITCH LOG FILE does a log switch and then leave it to ARCH to archive it anytime.


    Thanks


  6. #6
    Join Date
    Apr 2002
    Location
    Germany.Laudenbach
    Posts
    448

    Wink

    Yes !

    Orca

  7. #7
    Join Date
    Jun 2002
    Posts
    64
    Hi,

    Is there any other major difference between these two?

    If not, I would always prefer to do ALTER SYSTEM ARCHIVE LOG CURRENT instead of ALTER SYSTEM SWITCH LOG FILE.

    Thanks

  8. #8
    Join Date
    Feb 2001
    Posts
    66
    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.

  9. #9
    Join Date
    Jun 2002
    Posts
    64
    Of course you are right!

    But in the case of ARCHIVE LOG mode, if I use any of those it's going to have the same effect.


    Thanks


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width