Logfile Switch command in Oracle

Logfile Switch command in Oracle

Oracle has two ways to force a logfile switch.

ALTER SYSTEM SWITCH LOGFILE;

ALTER SYSTEM ARCHIVE LOG CURRENT;

Both will force a log switch log and move to another available redo log file(having status inactive).

Both commands work differently:

1. ALTER SYSTEM SWITCH LOGFILE

  • It is fast return control to user because it does not wait for the archiver process to complete writing the online redo log to archive log file.
  • It start writing to the new redo log file by issue checkpoint, then in back-group it tell archiver process to copy the redo to archive file.
  • In RAC environment it worked only on local node.
  • It is asynchronous process it only invoke the background process and control return to user.
  • It use current thread for archives only.

2. ALTER SYSTEM ARCHIVE LOG CURRENT

  • It is paused because it waits for the archiver process to complete its writing process of online redo log to archiver file.
  • In RAC environment it switch the logs on all RAC nodes.(recommended in RAC Environment).
  • It is synchronous because command waits until the online redo log has completed the writing of the redo log file to the file system.
  • In RMAN backup it is the trusted command.
  • You can specify the thread to archive in this command.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.