What Does Oracle do when executing commit?

Source: Internet
Author: User

Commit is a very fast operation. When we release the commit command, the really difficult operation has been completed,

Data changes have been performed in the database, so 99% of the tasks have been completed. For example, the following operations have been generated:

 

1. The undo block has been generated in the SGA (buffer cache;

2. A changed data block and index block have been generated in the SGA (buffer cache;

3. The redo information of the first two items is generated in the redo log buffer;

4. Depending on the data size produced by the first three items and the time required for the operation, the data in the buffer may have been

Some of them are output to the disk;

5. All required locks have been obtained;

When you run the commit command, only the following operations are performed:

1. Generate SCN for the transaction: SCN is a timing information of the Oracle database, to ensure the order of the transaction,

It is also used for failed recovery and database read consistency and checkpoint, no matter when someone submits, SCN

Automatically add 1;

2. Write the redo information related to the transaction not written to the redo log file from the redo log buffer to the redo log

File, this is the actual commit. After this step is completed, it indicates that the commit has been completed, and the transaction is

Remove from V $ transaction;

3. the locks of the transaction recorded in the V $ lock will be released, and other transactions requiring these locks will be awakened;

4. Execute block cleaning to clear the transaction information stored in the block header;

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.