Introduction to table Truncation in oracle

Source: Internet
Author: User

If you delete a piece of data in the table in Oracle, you can also perform rollback through the rollback operation (rollback). If you want to clear a piece of data
If you do not want to perform rollback on the table data, you can immediately release the resource. In this case, you need to use the truncation table. 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 personal computer, it is not completely deleted but enters 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:
Truncatetable table name.
Suppose we have created a tb_AW table
Createtabletb_AW (
Namevarchar (10 ),
Sexvarchar (2) default 'femal'
);
Insert data
Insertintotb_AW (name, sex) values ('job', 'male ');
Insertintotb_AW (name, sex) values ('zhou Xin hong', 'female ');
View table:
Select * fromtb_AW;
 
Truncation now
Truncatetabletb_AW ;;
To determine whether the table has been released, roll back and view
Rollback;

Output result:
 
Note that after the rollback, the information in the tb_AW table cannot be found, indicating that it has been completely deleted, which is the function of table truncation.

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.