Is there way to compare two DB2 schema objects (Tables, Columns, ) of Stage and Production

61 views
Skip to first unread message

debrath banerjee

unread,
Mar 19, 2020, 7:34:49 PM3/19/20
to
Is there way to compare two DB2 schema objects (Tables, Columns, ) of Stage and Production

We have to understand what is the difference between Production Database and Stage. What columns or Tables or any other changes missing in Production.

Help me with any solution or free version tool or query which could help.

Thanks

Thiruswamy

unread,
Mar 20, 2020, 2:40:59 PM3/20/20
to
Yes, we can compare. Which version, LUW/ZOS?

AngocA

unread,
Mar 21, 2020, 2:18:47 PM3/21/20
to
The only way to compare objects is by generating the DDL. The was to extract this is with db2look, but this tool generates the objects according to the creation time, thus the order could not be the same.

Also, you can extract the DDL of an object via a stored procedure. In this way, you can generate a set of objects, and then check the result.

Jeremy Rickard

unread,
Mar 22, 2020, 2:49:28 PM3/22/20
to
Instead of db2look you could diff relevant columns of relevant catalog views (such as syscat.columns) using SQL EXCEPT and INTERSECT operators.

The only real problem would be collocating the data in the same database. Either you would have to import a copy to staging tables with the same structure, or maybe federate for less effort? ("maybe" since I don't recall trying, is it possible to create a nickname on a catalog view?)

By the way, I thought this forum was dead! It seems a shame that IBM have promoted StackOverflow in the Knowledge Center instead of Groups/Usenet.


Jeremy Rickard

Thiruswamy

unread,
Mar 23, 2020, 8:53:34 AM3/23/20
to
There is ways to compare both DDL and Data of table on each row level also. First, we need to which version whether LUW/ZOS. There is some limitation on version level.

Rgds,
Thiru

Andreas Lerch

unread,
Mar 23, 2020, 11:46:58 AM3/23/20
to
Hello

some days ago a friend sends me this link:

http://jmerrell.com/2011/06/01/db2-except-sql-function/

I don't know if thats work, but you can try

Andreas Lerch


Am 20.03.20 um 00:34 schrieb debrath banerjee:
Reply all
Reply to author
Forward
0 new messages