Delete table in Oracle drop delete truncate

Source: Internet
Author: User

At the same point, using drop Delete truncate will delete the contents of the table

DROP table Name

Delete from table name (followed by the where statement, and all data in the table is also deleted)

TRUNCATE TABLE name

Difference

First, delete belongs to DML, which does not take effect when not commit.

The truncate and the drop are directly in effect and cannot be rolled back.

Truncate and delete Do not delete the structure of the table, except for the contents of the table

The drop statement will delete the structure of the table, dependent constraints (constrain), triggers (trigger), index; Stored procedures/functions that depend on the table are preserved, but become invalid states.

Truncate will free up space, and drop and delete will not.

Speed: Drop>truncate>dalete

In summary, you can get a problem that using drop and truncate relative to delete is dangerous and cannot be rolled back when using drop and truncate. Delete is relatively secure, can be rolled back, and commits are committed later, and the table structure is not deleted, and the space occupied by the table is not freed.

Delete table in Oracle drop delete truncate

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.