Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Slow deleting records

Re: Slow deleting records

From: Mungo Henning <mungoh_at_itacs.strath.ac.uk>
Date: 1998/11/17
Message-ID: <3651A731.33F266B5@itacs.strath.ac.uk>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US