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: massive delete

Re: massive delete

From: Chetan Wagle <chetanw_at_yahoo.com>
Date: Fri, 24 Sep 1999 10:42:08 +0530
Message-ID: <7sf14d$2pq$1@herald.ctp.com>


Hi Jorge,

   I am not quite clear about your reply :-(

  1. Is the solution no 1 helpful to you or not ?? The only idea behind using the rownum variable is to be able to commit frequently in between thus allowing one to work with smaller rollback segments.
  2. Truncate is a DDL command that frees all extents from the table and drops the high-watermark too, thus freeing up space which would probably lead to fragmentation on your disk.

HTH,
Chetan

Jorge wrote in message <7sdave$coq$1_at_diana.bcn.ttd.net>...
>>1. Rather than the cursor, you could delete with the help of the rownum
>>variable as follows:
>> SQL> delete from massive_table where rownum<10001 and ....;
>
>Good idea... I'll have to count how many rows to delete and loop N/10000
>times
>over "delete from xxxxx where (criterions) and rownum<10001;
>
>>2. If you want to delete all rows in the table use the truncate
>>tablestatement:
>> SQL> truncate table massive_table;
>
>Yes, but many rows can't be deleted from this table.
>
>One question more, will "truncate " command increase data fragmentation?
>
>thanks for all the replies.
> Jorge
>
>
Received on Fri Sep 24 1999 - 00:12:08 CDT

Original text of this message

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