Understanding redo (11) truncate and select redo

Source: Internet
Author: User
Many systems only perform a flag when performing the delete operation, and do not perform operations that are as expensive as setting the disk to 0. The same is true for truncate. Only the segmentheader and I-node tables are changed. Truncate generates redo, which is generated by modifying the data dictionary, rather than deleting the data. Truncate reduces HWM, releases extent, and regenerate data_object

Many systems only perform a flag when performing the delete operation, and do not perform operations that are as expensive as setting the disk to 0. The same is true for truncate. Only the segment header and I-node tables are changed. Truncate generates redo, which is generated by modifying the data dictionary, rather than deleting the data. Truncate reduces HWM, releases extent, and regenerate data_object

Many systems only perform a flag when performing the delete operation, and do not perform operations that are as expensive as setting the disk to 0. The same is true for truncate. Only the segment header and I-node tables are changed. Truncate generates redo, which is generated by modifying the data dictionary, rather than deleting the data. Truncate reduces HWM, releases extent, and regenerate data_object_id. It is faster than delete because it does not need to delete data at all. redo only records the operation itself and does not have redo records with a large amount of data. Therefore, for the truncate operation, if we know the previous data_object_id and the space is not reused, we can still retrieve the data.

Under what circumstances will select generate redo?

1 ') Fast block clearing or commit clean out. When a transaction is committed, Oracle targets memory blocks:

A) mark the flag in the itl entry as U.

B) Set commit scn In the Scn/Fsc Column

With these two tags, we can tell the world that this transaction has been committed. However, the Lck flag of the itl entry and the lb (Lock bit information) of each data row header are not cleared. Oracle does not generate logs when doing commit clean out, which may be strange to you. You have modified the block but did not generate logs. In fact, this log generation process is completed only when the complete blocks are cleared. That is, the next time we select this data block.

2) Delay block clearing. When a transaction is committed, the modified transaction block is no longer in the memory. At this time, Oracle will no longer read the block from the disk to the memory to clear the block, the next time you read data blocks, you can clear them. This block clearing action will generate a Redo.

In addition, due to recursive operations, session-Level Measurement of the redo generated by a transaction may be biased. It is reasonable to say that instance-level measurement is based on:

Select name, value from v $ sysstat where name = 'redo size ';
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.