Use the TRUNCATE statement to remove all rows from a table or cluster and reset the STORAGE parameters to the values when the table or cluster was created. Deleting rows with the TRUNCATE statement can be more efficient than dropping and re-creating a table. Dropping and re-creating a table invalidates the table's dependent objects, requires you to regrant object privileges on the table, and requires you to re-create the table's indexes, integrity constraint, and triggers and respecify its storage parameters. Truncating has none of these effects.
解决方案 »
- plsql 函数名@aa.bb 是什么意思啊
- 求一个SQL语句
- 请推荐几本使用Oracle SQL开发的经典教材
- oracle 通配符问题,急!急!急!急!
- 请高手帮我分析下一个ORACLE 的问题,急,在线等。。。
- 写存储过程的时候,行参要送表名,如何实现啊
- 怎么用pl/sql修改表名啊? 查了半天没搞定
- 一个关于clob字段的问题!
- 100分求救 :我在VB中使用ADO连接Oralce数据库时...(在线等待)
- Oracle的sql developer里面脚本输出部分出现乱码
- oracle问题 (imp出问题)欢迎大家讨论
- 请问在sl/sql中,怎样处理当要查询的表明也是变量的情况?请看例子。。。
To remove all rows from a table or cluster and reset the STORAGE parameters to
the values when the table or cluster was created.REUSE STORAGE
retains the space from the deleted rows allocated to the table or cluster. Storage values are not reset to the values when the table or cluster was created. This space can subsequently be used only by new data in the table or cluster resulting from inserts or updates.
The DROP STORAGE clause and REUSE STORAGE clause also apply to the space freed by
the data deleted from associated indexes.
Specify REUSE STORAGE to retain the space from the deleted rows allocated to the table or cluster. Storage values are not reset to the values when the table or cluster was created. This space can subsequently be used only by new data in the table or cluster resulting from inserts or updates.
但drop table 是将表结构和记录一同清除,且不可恢复。
truncate table 是将记录清除,且不可恢复,但保留表结构。
delete from 清空记录,但可以在commit之前进行rollback.
有什么用呢,是不是保留原有的空间,为以后再insert数据用的呢?
这样没有什么意义啊?
快速删除表,不写日志,保留存储介质中的数据。