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

Home -> Community -> Usenet -> c.d.o.server -> Re: Using SQL*Loader to update rows FAST - help!

Re: Using SQL*Loader to update rows FAST - help!

From: Richard Sutherland <rsutherland_at_In-Touch.net>
Date: Thu, 14 Dec 2000 16:59:44 -0500
Message-ID: <t3igctom1fom8b@corp.supernews.com>

You can speed things up and avoid rollback by:   CREATE TABLE new_table
  [physical attributes]

  NOLOGGING                          -- bypasses logging and rollback
segments
  AS SELECT * FROM old_table
  WHERE [get the rows that you want to keep (i.e., don't select the rows you don't want)].

Now use SQL*Loader with "direct=y" into new_table. Then drop old_table, index, grant privileges, whatever.

If 2,000,000 rows is the number you need to throw away, this may well be your best bet.

Richard

<chris_at_sportsrocket.com> wrote in message news:9172v1$sfv$1_at_nnrp1.deja.com...
> This is the situation:
> - A table with 4 million rows.
> - A batch job that needs to update half of the rows ASAP (ideally in
> under 5 minutes). These rows are easily distinguished using one of
> the primary key columns.
>
> I think SQL*Loader is the only way to get the rows in quickly enough,
> but it can only insert rows. Quoting the Oracle docs:
> - Load your data into a work table [using SQL*Loader].
> - Use the SQL language UPDATE statement with correlated subqueries.
> - Drop the work table.
>
> ...which doesn't seem very fast. I've thought of deleting the 2 million
> rows first, but how fast is that? Won't it generate a lot of redo and
> the like? And will SQL*Loader reuse the deleted space (I think not)?
>
> This can't be that uncommon. Is there a better way? Thanks for any
> input!
>
> --Chris
>
>
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Thu Dec 14 2000 - 15:59:44 CST

Original text of this message

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