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: Fastest way to check for dupes

Re: Fastest way to check for dupes

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Fri, 08 Mar 2002 10:16:44 GMT
Message-ID: <3c888d2d.5710505@news.saix.net>


Thomas Kyte <tkyte_at_oracle.com> wrote:

>I would be tempted to create a new table C
>
>create table c
>as
>select * from b
>minus
>select * from a;

To which I will add:
drop table b;
rename table c to b;

As you can point out to your management Ryan - the fact that a "new" table has been created as part of this process has _NOTHING_ to with any logical data model design issues.

Just remember to re-create the constraints and indexes for table b after this process. If that proves to be too complex and difficult, you can do :
truncate table b;
insert into b select * from c;
drop table c;

You can do the INSERT using parallel DML if the data volumes are large. Oh yeah - and remember the commit and to add exception checking before dropping table c in case the insert failed (e.g. some kind of space problem with rollbacks, index or data space).

If they still question you, maybe you should point out that Thomas here are one of the best known Oracle experts on the globe.

--
Billy
Received on Fri Mar 08 2002 - 04:16:44 CST

Original text of this message

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