Understanding the basic concepts of redo log (1) Media recovery and instance recovery

Source: Internet
Author: User

In the Oracle world, there are three types of data: undo, redo, and data. Redo is a mechanism generated by "no loss of committed transactions" to serve two types of scenarios: instance recovery and media recovery.

Instance recovery objective: to ensure data loss in buffer cache and Database Consistency when the database fails
Media recovery objective: to restore data when data files fail

Redo is organized by thread. For a single instance, there is only one thread; For RAC, there may be multiple threads.

The redo log mechanism is private: each instance has its own log buffer. However, in the RAC environment, redo log files are shared.

Either way, the first step is (the status of the data file)BorrowRedo data rollback (UNDO data files are also rolled forward) until the last available redo log or archive log.

Furthermore, Oracle's cache mechanism is performance-oriented and is not used for storage. For this purpose, Oracle must handle two problems:

1) how to ensure that the committed transactions are not lost?
2) how to balance the instance recovery time?

First problem: Log-force-at-commit Mechanism
Logs are written when commit is used. logs are written only when commit complete is returned. Even if "Commit compl" is returned, the logs are not written even when a sudden power failure occurs.
Second problem: Checkpoint Mechanism
Data is read by the server process, but not written. The buffer cache write operation is completed by dbwn. dbwn writes part of data to the data file based on workload and whether it is used by other processes, this is random. The checkpoint mechanism is an effective supplement to this situation. When a Check Point occurs, the ckpt process requires dbwn to write all the dirty buffers before an SCN back to the data file. After a checkpoint is completed, all data changes before the SCN are saved to the disk. If a fault occurs at this time, the previous changes to this event do not need to be considered.

Related Article

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.