473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Does DB2 UDB v8 come with a compare tool?

mjf
I need to come up with a tool to compare the table definition and/or
its data before and after some modification to the DDL or some tests
(that change the data). Does DB2 come with such a tool, or do I need to
write my own? Thanks.

Jan 30 '06 #1
8 2529
mjf wrote:
I need to come up with a tool to compare the table definition and/or
its data before and after some modification to the DDL or some tests
(that change the data). Does DB2 come with such a tool, or do I need to
write my own? Thanks.

There is no pre-packaged tool. You can run db2look before and after and
get some text diff which may be helpful for the schema.
Now.. I see requests like this pop up in this group in regular interval.
Would you mind sharing the business problem and what you expect this
tool to do? Maybe I can whip something up if it's not too hard.

E.g. how should the reoprt of this tool look like? Which mismatches
should it flag and which should it ignore.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Jan 30 '06 #2
Ian
Serge Rielau wrote:
mjf wrote:
I need to come up with a tool to compare the table definition and/or
its data before and after some modification to the DDL or some tests
(that change the data). Does DB2 come with such a tool, or do I need to
write my own? Thanks.

There is no pre-packaged tool. You can run db2look before and after and
get some text diff which may be helpful for the schema.
Now.. I see requests like this pop up in this group in regular interval.
Would you mind sharing the business problem and what you expect this
tool to do? Maybe I can whip something up if it's not too hard.


There are 3rd party tools that can handle DDL comparisons - BMC and
Quest Software both provide this functionality.

Comparing data in 2 tables is challenging; had to do this for a
migration once. It can be done with SQL, see the INTERSECT and EXCEPT
keywords. :-)


Jan 30 '06 #3
mjf
Hello Serge,

Thank you very much for your reply.

Here is a typical scenario for DDL change: the developers may add
(quite often) or drop (not often) columns into/from tables during
development of an application, according to the data they see that are
needed for the application and was not considered in the previous
database design. Then when the next release comes up, they will
implement an upgrade script to include all the changes that have been
done to the application and the related software (which includes the
modification to the database DDL), in order to upgrade all the other
machines that run this application. If we can see what has been changed
to tables and columns, then we can write a SQL script to update all of
them at one go for each machine.

And here is a typical scenario for data modification: let's say an
application drives a real-time system (hardware), meaning the
modification to the data in the database can change the behavior of the
system. The developers/testers would change some parameters (which are
saved into and retrieved from the database by the app) to fine tune how
the system moves, how much the system moves, etc. At the end of the day
or at certain point when they are satisfied with the system, they would
like to see which parameters have been modified, do some analysis, and
eventually establish a set of parameters as template for the other
systems.

I guess the simplest will be a tool similar to the "diff" on Linux (I
assume a tool with a GUI will take much longer to develop), where it
flags all the tables that have been modified, all the columns that have
been added or removed or modified (such as column size), and if
possible, all the constraints, sequence numbers, & triggers that have
been added or removed. Difference on whitespaces and new lines can be
omitted. Actually for now just the changes to a table (adding,
removing, and modification of columns) should be enough.

Thanks.

Jan 30 '06 #4
mjf
Hello Ian, thanks for the info! I'll check them out.

Jan 30 '06 #5
Serge Rielau wrote:
mjf wrote:
I need to come up with a tool to compare the table definition and/or
its data before and after some modification to the DDL or some tests
(that change the data). Does DB2 come with such a tool, or do I need to
write my own? Thanks.

There is no pre-packaged tool. You can run db2look before and after and
get some text diff which may be helpful for the schema.
Now.. I see requests like this pop up in this group in regular interval.
Would you mind sharing the business problem and what you expect this
tool to do? Maybe I can whip something up if it's not too hard.

E.g. how should the reoprt of this tool look like? Which mismatches
should it flag and which should it ignore.

Cheers
Serge


The problem I've found with db2look is that it outputs the DDL in strict
"last created / altered" order. The reason why is obvious : it makes it
easy to produce a DDL script which can run without any problems of "object
creation order" if you create it in an order which has run successfully
before.

However this format is virtually useless for doing a diff against.

Another problem is that of differences of white space, indentation and the
like.

What I wrote is a little utility which strips out the white space and sorts
the statements from db2look in alphabetic order. Not much use for
running, but the first step in identifying which objects have changed.

If anyone is interested I can make this script available.

Phil
Jan 30 '06 #6
mjf
Hello Philip, can you please email me the script (if it's too long to
post it here)? Thank you very much.

Jan 30 '06 #7
mjf,
From your requirements, it seems like the open-source SchemaCrawler

tool will do what you need. SchemaCrawler outputs details of your
schema (tables, views, procedures, and more) in a diff-able plain-text
format (text, CSV, or XHTML). SchemaCrawler can also output data
(including CLOBs and BLOBs) in the same plain-text formats. You can use
a standard diff program to diff the current output with a reference
version of the output. SchemaCrawler can be run either from the command
line, or as an ant task. A lot of examples are available with the
download to help you get started.

SchemaCrawler is free, open-source, cross-platform (operating system
and database) tool, written in Java, that is available at SourceForge:
http://schemacrawler.sourceforge.net/
You will need to provide a JDBC driver for your database. No other
third-party jars are required.

Once you get familiar with SchemaCrawler's Java API, you can even
write plug-ins that will automatically generate the scripts that you
need.

Sualeh.

Jan 31 '06 #8
su***********@gmail.com wrote:
mjf,
From your requirements, it seems like the open-source SchemaCrawler

tool will do what you need. SchemaCrawler outputs details of your
schema (tables, views, procedures, and more) in a diff-able plain-text
format (text, CSV, or XHTML). SchemaCrawler can also output data
(including CLOBs and BLOBs) in the same plain-text formats. You can use
a standard diff program to diff the current output with a reference
version of the output. SchemaCrawler can be run either from the command
line, or as an ant task. A lot of examples are available with the
download to help you get started.

SchemaCrawler is free, open-source, cross-platform (operating system
and database) tool, written in Java, that is available at SourceForge:
http://schemacrawler.sourceforge.net/
You will need to provide a JDBC driver for your database. No other
third-party jars are required.

Once you get familiar with SchemaCrawler's Java API, you can even
write plug-ins that will automatically generate the scripts that you
need.

Sualeh.


An interesting link, but will a generic tool like this produce all the DB2
specific DDL we are looking for ?

There are lots of tools on the market for looking at database schemas,
including some costing a considerable amount of money, but I've always
found that you have to treat what they produce with caution.

For example, at my "day job" we have Embarcadero DBArtisan. Not exactly
"free", but it still seems to struggle with the DB2 specifics. Issues
with the current release include incomplete or missing routine authorities,
which really messes things up when we want to do a change "transparent to
the users".

Phil
Jan 31 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jyoti | last post by:
I am new in asp. I have two html files. I like to write code to compare those two files. I like to show the difference as highlighted area. Example: File 1 contains: <html><body> Compare...
2
by: Nathan Rosaaen | last post by:
I want to be able to easily see what changes were made from original to updated sentences (words added/removed/changed). I'm not too concerned about speed, just looking for something. The compared...
4
by: roni | last post by:
hi. is there a tool that compare 2 vs.net projects and show the differences in code ? (in text..) such tool will help me alot to see changes i made between backups for example. have a...
6
by: rabii | last post by:
Hello, I'm using Entreprise Manager (for Sql Server 2000) to generate my database's script. By mistake, i've changer FillFactor one time. And, now I can't remove this data from generated sql...
1
by: serge | last post by:
Can someone recommend what SQL Database compare tool to use and why? Thank you
26
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
0
by: TimKnoll | last post by:
I want to compare to large (4+ MB) XML files from a C# program. I'm currently using The XML Diff and Path tool from Microsoft's site. The performance on the larger files isn't acceptable. Has...
0
by: dingo | last post by:
DBC (Database Compare) is a fast, comprehensive database structure and data comparison tool.Sort sync scipts with database dependencies. www.d-softs.com
5
by: teddysnips | last post by:
I have upsized a client's application from Access BE/FE to Access FE/ SQL Server. All is fine with initial testing, and they want to run the systems in parallel prior to going live. The MD, who...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.