Redo and undo

Source: Internet
Author: User

Redo-> record all operations for recovery (redo records all the database transaction used for recovery)

The Redo function is to restore committed transactions, so as to ensure that the transactions committed by the user can be restored no matter when the media fails or the instance fails, so that the database is in a consistent state.

The implementation of the Redo function depends on the following three components:

Log buffer

Lgwr

 Online redo log files and archive log files

 

 

 

Undo-> record all the previous impressions for rollback (undo is used to store uncommitedDataInfor used for rollback)

 

The role of Undo is:

 

- Rollback operation;

 

- Read consistency is supported;

 

- Recover failed transactions.

 

Undo is implemented through the Undo segments in the undo tablespace. Each transaction is assigned only one undo segment, which can serve multiple transactions.

 

The Undo mechanism only logically restores data to the state before modification, rather than physically recovering data.

 

 

 

 

The reason for redo is that the changes to data are immediately written to online redo each time a commit is made, but the changes to the data are not necessarily written to the data file at the same time. Because the data has been submitted, but only exists in the online log file, you need to find the data from the online log file and apply it again during restoration, make the changed data in the data file!

 

The reason for undo is:OracleDuring normal operation, to improve efficiency, if the user does not have a commit, but there is not much idle memory, the DBWR process will write the dirty block into the data file, to free up valuable memory for other processes. This is why UNDO is required. Since no commit statement has been issued, the dbwr process of oracle has written uncommitted data to the data file.

Redo and undo

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.