Re: Comparing tables in two DBs

From: Ted Goulden <gouldent_at_cadvision.com>
Date: 1996/08/19
Message-ID: <4v924i$3vio_at_elmo.cadvision.com>#1/1


        I never actually followed through and did this, but after discussions with other developers I think this is about the easiest approach of all:

SELECT * FROM TABLE_at_INSTANCE1
MINUS
SELECT * FROM TABLE_at_INSTANCE2;

        This should give you both the missing/extra rows and rows with updates to some columns. Let me know if this actually works or if there is a better way.

Lou Avrami <lavrami_at_attmail.com> wrote:

>Hello all,
 

> We have an application that runs on UNIX SVR4, Oracle 7.1.6.
 

> Another site is experiencing problems with the application,
>and it appears to be related to the application reference tables
>within the database.
 

> The other site has sent a full export of their database, and
>I have imported it into an instance on one of our local machines. I
>have been charge with the task of comparing the contents of these
>application reference tables (100+) in our database and the import of
>the other site.
 

> Does anyone have any suggestions as to the best way to
>accomplish this? Perhaps the easiest (and ugliest) way to do this
>would be to dump the sorted contents of each imported table into an
>ASCII file, and then run the UNIX commands 'diff' and 'comp' against
>the ASCII counterpart from our local database. I would like to avoid
>doing this.
 

> My initial thoughts are to establish a database link between
>our local (good) DB and the instance with the remote (bad) DB. I then
>want to construct queries that will search for records within each
>table of the good DB, and see if they exist in the table of the bad
>DB. I think that PL/SQL would be better for this than other tools,
>but I'm not sure ... I've only been thinking about how to go about
>this a couple of minutes.
 

> Any thoughts, suggestions, code, examples, etc. would be
>greatly appreciated.
 

>Thanks,
 

>Lou Avrami
>AT&T
Received on Mon Aug 19 1996 - 00:00:00 CEST

Original text of this message