Use of table Truncation in oracle

Source: Internet
Author: User


If you delete a piece of data from a table in oracle, you can also perform rollback by performing the rollback operation (rollback). If you want to clear the data of a table www.2cto.com, if you do not want to perform rollback, you can immediately release the resource. In this case, you need to use table truncation. Its main function is to completely delete data so that it cannot be rolled back. For example, you can immediately understand its role. As we all know, when we delete a file on our PC (person computer), it is not completely deleted but moved to the recycle bin, you need to delete it in the recycle bin before it is completely cleared. Table truncation is equivalent to directly deleting data from the pc without putting it in the recycle bin. Table truncation: truncate table name. Suppose we have created a tb_AW table create tabletb_AW (name varchar (10), sex varchar (2) default 'femal'); insert data into tb_AW (name, sex) values ('Joe ', 'male'); insert into tb_AW (name, sex) values ('zhou Xin red', 'female'); view table: select * from tb_AW; now truncate table tb_AW; to determine whether the table has been released, roll back to check the rollback. Output: note that the information in the tb_AW table cannot be found after rollback, it indicates that it has been completely deleted. This is the table truncation function.

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.