René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
truncate table|cluster [Oracle SQL] | ||
truncate table table_name; truncate cluster cluster_name;
A statement like delete from tablename deletes all records in the table, but it does not free any space
(see On table sizes).
In order to free the space as well, use truncate. However, a
truncate can not be rolled back.
Basically, a truncate statement resets the
high water mark to its
initial position.
A truncate statement cannot be used on a synonym.
The truncate statement is not the same as the trunc statement.
Steps involved
Oracle executes the following steps for a truncate statement:
Links |