What is the difference between DELETE and TRUNCATE?
Answer Posted / brajendra arzare
Deletes perform normal DML. That is, they take locks on
rows, they generate redo and they require segments in the
UNDO tablespace. Deletes clear records out of blocks
carefully. If a mistake is made a rollback can be issued to
restore the records prior to a commit.
Truncates are DDL and truncate moves the High Water Mark
of the table back to zero. No row-level locks are taken, no
redo or rollback is generated.so they have the same effect
as a delete, but without all the overhead. Just one slight
problem: a truncate is a DDL command, so you can't roll it
back if you decide you made a mistake. (It's also true that
you can't selectively truncate -no "WHERE" clause is
permitted, unlike with deletes, of course).
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
how to concatenate two character strings? : Sql dba
What is a common use of group by in sql?
How does a covering index work?
What does bitemporal mean?
What is the difference between the implicit and explicit cursors?
Where the sql database files are stored?
How do I create a sql database?
What is the purpose of my sql?
Is it possible to link two groups inside a cross products after the cross products group has been created?
What is the difference between join and natural join?
describe mysql connection using mysql binary. : Sql dba
How to Declare Fixed Length String Value In PL SQL
what is meant by urlencode and urldocode? : Sql dba
How do I view stored procedures?
Can we write dml inside a function in sql server?