in reply to Comparing tables over multiple servers

are these html tables?...same number rows/columns?..are you wanting also to check that the html markup is same? give us something. why does it seem like it will take a long time?..have u attempted any code?
the hardest line to type correctly is: stty erase ^H
  • Comment on Re: Comparing tables over multiple servers

Replies are listed 'Best First'.
Re^2: Comparing tables over multiple servers
by mnlight (Scribe) on Oct 27, 2005 at 15:26 UTC
    No I have not attempted any code. The issue just came up late yesterday. So I have been contemplating the best way of doing it. I am working on it today. All I want to do is compare the data row by row. The tables are all the same. They are system tables in sybase. We had some issues arise with our roles and want to verify that we are synchronized accross ENV. Each instance of sybase is running on it's own box. I would like this to be something we could use in the future. I guess I see it taking a long time because I would have to build an array for each table and then compare each array to the other e.g. a1 compares to a2, a3, a4, a5, a6, a7
    a2 compares to a3, a4, a5, a6, a7 ...
    If in the future we want to do this with some larger tables it might be really tedious. Just some ideas not looking for new applications just something quick that might have some future value.
      That comparison list reminds me of a proof technique (from when I once studied/taught math). I think you can compare in a ring. That is compare a1 to a2, then a2 to a3, a3 to a4, ... keep going until you compare a7 to a1. Each step reports any differences. If there are none, everything is good. Only seven comparisons are needed.

      Phil

      I like BrowserUK's solution.

      Alternatively - as these are system tables and are fairly small, I'd extract the data (via perl, isql, bcp) making sure that each table is always sorted in the same way, and then use plain old diff to get an idea of what is incorrect.

      If the problem lies in incorrect role definitions then the number of tables that need to be checked is fairly limited, so doing it this way is reasonable, and can be completed fairly quickly.

      Michael