The relationship of delete and truncate in Oracle

Source: Internet
Author: User

Transferred from:http://chenxy.blog.51cto.com/729966/168459

1, the same point a. You can delete data, where truncate is used for full table emptying data, and delete can choose to delete 2, different points: A. rollback, delete supports the rollback of things, and truncate does not support them. Extension: In Oracle, things can be rolled back because of the undo table space designed in Oracle. The data can still be rolled back after it is deleted because the data is put in the undo Tablespace Delte belongs to the DML language, the DML language needs to submit things manually, can be transacted rollback truncate belongs to the DDL language, the DDL language is implicitly committed, and therefore cannot be rolled backB. High WaterlineTables in Oracle are used to hold the upper limit of data.              High water mark (which can be visually understood as the highest water level in the reservoir), in general, grows to 5 data blocks at a time. When the delete operation executes, it does not affect the data block that is occupied by the data, and the high watermark remains unchanged when the truncate operation executes, freeing up the data footprint. High waterline position decreased. can also be reset through the reuse store can be observed through the database of the Block command, the Oracle allocation zone when the default is 7+1, the growth is 5. Some of these SQL optimizations are for data footprint, because When data is consulted, a full table scan is performed whenever the data space is occupied, even if the table has no data.c. Space occupancyDelete is not released, while truncate reclaims the data spaced. EfficiencyCan be compared by the time it takes to delete the data, conclusion: Truncate>delete, (because Delte put the data in the Undo table space)

The relationship of delete and truncate in Oracle

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.