The difference between alter system switch logfile and alter system archive log current

Source: Internet
Author: User

ALTER system switch logfile is a force log switch that does not necessarily archive the current redo log file (if an automatic archive is turned on, the redo log before archiving, if the automatic archive is not open, do not archive the current redo log.) )
Alter system archive Log current is the archive of the present redo log files, regardless of whether the automatic archive has been filed.
The main difference is:
ALTER SYSTEM Switch logfile performs a log switch on the current instance in a single instance database or RAC;
Alter SYSTEM ARCHIVE log switch for all instances in the database.

Why do I perform the statement of ALTER system archive log current after hot standby, and see that many scripts are written like this.
was not necessary.

The general Rman script is written in this way, because Rman can back up the archive log. Alter system archive Log current enables you to back up all of your archives. This is done to ensure the integrity and consistency of the data.

ALTER SYSTEM SWITCH LOGFILE;
SWITCH LOGFILE Clause
The SWITCH LOGFILE clause lets you explicitly force Oracle to begin writing to a new redo log file group, regardless of wh Ether the files in the current redo log file group are full. When you are force a log switch, Oracle begins to perform a checkpoint but returns control to your immediately rather when The checkpoint is complete. To use this clause, your instance must have the database open.

ALTER SYSTEM ARCHIVE LOG current;
Current Clause
Specify manually archive the current redo log file group of the specified thread (instance), forcing a log switc H. If you are omit the THREAD parameter, then Oracle archives all redo log file groups to all-enabled threads (instances), in cluding logs previous to current logs. You can specify the ' when ' the database is open.

ALTER SYSTEM ARCHIVE LOG current noswitch;
Noswitch
Specify Noswitch If you are want to manually archive the current redo log file group without forcing a log switch. This setting are used primarily with standby databases to prevent data divergence the primary database. Divergence implies the possibility of data loss in case of primary database failure.

You can use the Noswitch clause only if your instance has the database mounted not open. If The database is open, then this operation closes the database automatically. Must then manually shut down the database before you can reopen it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.