Re: Quicker way to Delete

From: Bobak, Mark <Mark.Bobak_at_proquest.com>
Date: Thu, 18 Jul 2013 19:36:58 +0000
Message-ID: <CE0DBAE4.30FF5%Mark.Bobak_at_ProQuest.com>



As with all things, it depends.

If you can tolerate downtime:

Create table temp no logging as select * from tab_w_220m_rows where <conditions specifying rows you want to keep>; Truncate table tab_w_220m_rows;
For each index on tab_w_220m_rows, do:
Alter index <index_name> unusable;

Alter table tab_w_220m_rows nologging;
Insert /+* append */ into tab_w_220m_rows select * from temp;

For each index on tab_w_220m_rows, do:
Alter index <index_name> rebuild nologging;

Hope that helps,

-Mark

On 7/18/13 3:28 PM, "Bala" <oratips_at_gmail.com> wrote:

>Software version : Oracle 11gR2 (11.2.0.3) RAC on Redhat 6
>
>On Thu, Jul 18, 2013 at 3:27 PM, Bala <oratips_at_gmail.com> wrote:
>
>> Gurus,
>>
>> Any quicker way to delete 30 million records (based on condition) from a
>> table with 220 million records ?
>>
>> Any pointers greatly appreciated.
>>
>> Thank you all for your time.
>>
>> --
>> Bala Rao
>>
>
>
>
>--
>Bala Rao
>
>
>--
>http://www.freelists.org/webpage/oracle-l
>
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jul 18 2013 - 21:36:58 CEST

Original text of this message