If a piece of data in the table is deleted in Oracle, you can also perform rollback through the rollback operation (rollback). If you want to clear the data in a table, however, if you do not want to perform rollback, you can immediately release the resource. In this case, you need to use the truncation table.
If a piece of data in the table is deleted in Oracle, you can also perform rollback through the rollback operation (rollback). If you want to clear the data in a table, however, if you do not want to perform rollback, you can immediately release the resource. In this case, you need to use the truncation table.
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.