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: How to delete many rows quickly?

Re: How to delete many rows quickly?

From: Jerry Gitomer <jgitomer_at_hbsrx.com>
Date: Mon, 30 Aug 1999 12:35:46 -0400
Message-ID: <7qejce$jrj$2@autumn.news.rcn.net>


Hi Leon,

        Look into either the use of Partitioned Tables or Views with Unions. Partitioned Tables are easier to use, but if it requires the Enterprise Edition and you have Work Group Server you have to use views. Assuming that you can't use Partitioned Tables here is a solution:

  1. Create a separate table for each day of the week.
  2. Create a view as follows:
            CREATE VIEW <weeks_logs> AS
            SELECT * FROM <sunday_logs>
            UNION
            SELECT * FROM <monday_logs>
            UNION
            .
            .
            .
            SELECT * FROM <saturday_logs>;

    3. Store into the appropriate day's log table as events occur

    4. Reference the data via the view     5. Write OS scripts to invoke a sqlplus script that does a TRUNCATE TABLE the next day's table and run the appropriate one every night.

Regards
Jerry Gitomer

david.archer_at_chase.com wrote in message <7qe6f0$pu6$1_at_nnrp1.deja.com>...
>If your not concerned with the rollback log ... TRUNCATE TABLE
<table
>name>. Please use this with care. You can not ROLLBACK after a
>truncate since nothing was logged.
>
>DA
>
>
>In article <7qdt9n$j7f$1_at_nnrp1.deja.com>,
> leongjack_at_my-deja.com wrote:
>> Hi,
>> I use oracle 8.0.5 for solaris to process the logs, there
are
>> several millions of logs per day, I can load the logs into
database
>> quickly( with the sql loader ), but when I want to delete the
outdate
>> logs from the database, I meet trouble. Though I make the
rollback
>> segment large enough to store the rollback infomation, the
speed still
>> too slow to bear. How can I remove the rows quickly.
>>
>> thanx in advance.
>>
>> Sent via Deja.com http://www.deja.com/
>> Share what you know. Learn what you don't.
>>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Mon Aug 30 1999 - 11:35:46 CDT

Original text of this message

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