Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Slow deleting records
Warning: the command "TRUNCATE" is DDL so there will be an implicit COMMIT before and after it. Although it does sound that a TRUNCATE is what's needed here, beware of the implicit commit.
commit; insert ... ; savepoint b; delete all records from table X;
If you replace the "delete" in the above with "truncate" then you lose the savepoint and you also commit the insert. If you leave it as a delete, you can always rollback to the savepoint.
HTH Mungo Henning
Nick Lehane wrote:
>
> These are possibilities, but I recently had exactly the same problem and it
> turned out to be the rollback segments in my dbspace. When you delete from
> a table it holds a copy of the deleted records in a rollback segment so
> that you can change your mind and restore them. If you are deleting and
> are sure you definitely won't want to rollback, you can use the TRUNCATE
> command instead, ie
>
> TRUNCATE TABLE tablename;
>
> NB This PERMANENTLY deletes records so be careful how you use it.
>
> I would however suggest trying the other suggestions first.
>
> Good luck,
>
> Nick
Received on Tue Nov 17 1998 - 00:00:00 CST
![]() |
![]() |