On Wed, 25 Aug 1999, Radhika Maruvada wrote:
> Hello,
> 
> I read your answer for finding number of rows in each table in a database.
> 
> I want to know if there is any way to generate a report for number of rows 
> in each table in two different databases.
> 
> for example, production and marketing are two databases with same tables. I 
> want to compare rows in each table in these two databases.
> 
> Right now I am querying twice and running the report in Access.
> 
> Thanks for any help.
> 
> Radhika
> 
To: Radhika Maruvada 

Radhika,

Assuming that GLOBAL_NAMES is set in the init.ora and you have an Oracle
listener running on both servers (or you have a database link between your
two databases), you CAN compare data.

Say you have the PROD database (production) and MARKET database
(marketing). To see the difference in the number of rows, you can do:

1) In the PROD database:
   SELECT COUNT(*) FROM table_name;       <-- shows # rows in PROD
   SELECT COUNT(*) FROM table_name@MARKET <-- shows # rows in MARKET

2) In the MARKET database:
   SELECT COUNT(*) FROM table_name@PROD;  <-- shows # rows in PROD
   SELECT COUNT(*) FROM table_name        <-- shows # rows in MARKET

Best regards,

-Ari Kaplan
Independent Oracle DBA Consultant

<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 315+ Oracle tips, visit my Web Page:                      <->
<->                                                               <->
<->             http://www.arikaplan.com                          <->
<->                                                               <->
<->             email: akaplan@interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->

Back to Ari Kaplan's Home Page .htm"> Back to Ari Kaplan's Home Page