RE: Quick and dirty way to compare table contents

  • From: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxxxxx>
  • To: <ranko.mosic@xxxxxxxxx>, "Mercadante, Thomas F (LABOR)" <Thomas.Mercadante@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 22 Feb 2006 15:21:17 -0500

I think you need to have a conversation with your boss that goes
something like this:
 
"Hey boss, you can ask me to do something, or you can tell me how to do
it....but you can't do both!"  ;-)
 
My point is, he wants an answer to a question, that being "Is the data
in these tables in these two databases the same or not?"  As long as the
method is valid, what business does he have dictating what methods
should not be used?
 
I know, there are impossible bosses all over the place, but, really, he
needs to let you do your job.
 
 
Ok, here's an actual attempt to answer your question:
Spool contents of table to a file, compute md5 sum.  
Spool contents of other table to file, compute md5 sum.
Compare md5 sums.
 
Hope that helps,
 
-Mark
 
 
 

-- 
Mark J. Bobak 
Senior Oracle Architect 
ProQuest Information & Learning 

"Exception:  Some dividends may be reported as qualified dividends but
are not qualified dividends.  These include: 

* Dividends you received on any share of stock that you held for less
than 61 days during the 121-day period that began 60 days before the
ex-dividend date.  The ex-dividend date is the first date following the
declaration of a dividend on which the purchaser of a stock is not
entitled to receive the next dividend payment. When counting the number
of days you held the stock, include the day you disposed of the stock
but not the day you acquired it. See the examples below. Also, when
counting the number of days you held the stock, you cannot count certain
days during which your risk of loss was diminished.  See Pub. 550 for
more details."

  --IRS, Form 1040-A Instruction Booklet, Line 9b:  Qualified Dividends 

 

________________________________

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Ranko Mosic
Sent: Wednesday, February 22, 2006 3:07 PM
To: Mercadante, Thomas F (LABOR)
Cc: Guang Mei; _oracle_L_list
Subject: Re: Quick and dirty way to compare table contents


I think my boss wants programmatic solution here, something like
summarizing data in certain columns and comparing values. 
 
Regards, Ranko

 
On 2/22/06, Mercadante, Thomas F (LABOR)
<Thomas.Mercadante@xxxxxxxxxxxxxxxxx> wrote: 

        Well can you:

         

        Create table cpytable1 as select * from table1;

        Export cpytable1;

        Import cpytable1 into other database.

        Then use minus to compare the two tables?

         

        
________________________________

        From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Ranko Mosic
        Sent: Wednesday, February 22, 2006 2:54 PM
        To: Guang Mei
        Cc: _oracle_L_list
        Subject: Re: Quick and dirty way to compare table contents

         

        Thanks Luis and Guang. 

        I personally like spool&diff option but my boss doesn't, so
can't use that.

        minus option is not an option because tables are in different
databases, no link. 

         

        
        
         

        On 2/22/06, Guang Mei < GMei@xxxxxx <mailto:GMei@xxxxxx> >
wrote: 

        If you only need to compare the contents , you can use

         

        select * from table1 minus select * from table2;

         

        select * from table2 minus select * from table1;

         

        Guang

                -----Original Message----- 
                From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:
oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Ranko Mosic 
                Sent: Wednesday, February 22, 2006 2:40 PM
                To: _oracle_L_list
                Subject: Quick and dirty way to compare table contents

                Hi list, 

                I need to quckly compare tables in 2 schemas to verify
contents are identical.

                Counting blocks/rows, using tools to compare schemas is
not possible. 

                Something similar to checksum mechanism is requested.
Any ideas ? 
                 
                -- 
                Regards, 
                Ranko Mosic
                Contract Senior Oracle DBA
                B. Eng, Oracle 10g, 9i Certified Database Professional
                Phone: 416-450-2785 
                email: mosicr@xxxxxxxxxx
        
http://ca.geocities.com/mosicr@xxxxxxxxxx/ContractSeniorOracleDBARankoMo
sicMain.html 
                 

        
        
        
        -- 
        Regards, 
        Ranko Mosic
        Contract Senior Oracle DBA 
        B. Eng, Oracle 10g, 9i Certified Database Professional
        Phone: 416-450-2785 
        email: mosicr@xxxxxxxxxx
        
http://ca.geocities.com/mosicr@xxxxxxxxxx/ContractSeniorOracleDBARankoMo
sicMain.html 




-- 
Regards, 
Ranko Mosic
Contract Senior Oracle DBA 
B. Eng, Oracle 10g, 9i Certified Database Professional
Phone: 416-450-2785
email: mosicr@xxxxxxxxxx
http://ca.geocities.com/mosicr@xxxxxxxxxx/ContractSeniorOracleDBARankoMo
sicMain.html 

Other related posts: