Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how to rebuild index after direct path load?
My policy always have been never load external data (usually shitty) into a
production table.
One way to go is to load your new data in a temporary table.
One other way to go is to use option 2), add a timestamp to the target
table, which is set only upon insert (so timestamp date default sysdate
should do the trick), and this will enable you to differentiate, assuming
you don't load two sets at the same time.
Hth,
--
Sybrand Bakker, Oracle DBA
<hkpang_at_my-deja.com> wrote in message news:81hbog$6q4$1_at_nnrp1.deja.com...
> Hi,
>
> I need to upload a huge dataset into an existing table. If the dataset
> contains duplicate keys, I want to the delete the old ones already in
> the table.
>
> My current approach is using sqlldr direct path. Since the data
> contains duplicate keys, the primary key index is violated and put in
> direct load state afterward.
>
> Now my problem is how to rebuild the index *and* eliminate the
> duplicates?
>
> 1) use a delete command to eliminate the duplicates. this kind of works
> but the performance is unacceptable. i potentially have millions to
> delete.
>
> 2) drop the index before upload, reenable the index with exceptions
> going to an exception table. the probelm is that both the old rows and
> the new rows are in the table, there is no way I can figure out which
> one to eliminate.
>
> Any suggestions???
>
> Many thanks for making a happy thanksgiving possible. :-)
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Nov 24 1999 - 13:40:15 CST
![]() |
![]() |