Oracle redo and undo

Source: Internet
Author: User

What to do before the transaction is committed

Before submitting a transaction, Oracle must do the following:

① Remember what the data looks like before it is modified

② Remember what data will be changed soon

③ Remember the association between redo log and undo log

④ Modify the data read to memory in SGA to a new value (which is not actually saved to the data file)

The first step is to record the undo log in the undo tablespace. Step 2 and Step 3 are completed by writing records to the redo log buffer in SGA. In this way, when the transaction is rolled back, the corresponding undo log can be found from the redo log to retrieve the previous data.

★Note that the DBWn process may not be triggered at this time.

★Note that the change in transaction operations recorded in step 1 is performed in the memory and has not been written to the redo log file on the disk.

What is done when a transaction is committed

① Record SCN value (System Change Number)

② Store online redo log records (in the SGA redo log buffer) to the redo log file

③ Oracle releases resources and locks

④ Oracle marks the transaction as ended

Note: Only after the commit command is sent Will the content of the redo log file in the SGA re-executed log buffer be refreshed to the disk. Before the LGWR process is executed, the redo log is stored in the memory, also known as the online redo log.

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.