Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Fastest way to check for dupes
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.
-- BillyReceived on Fri Mar 08 2002 - 04:16:44 CST