Schema DIFF needed for big databases
Posted in 2020
Topics: General Discussion
Hello, I need to find all changes between two databases that have the same origin but "alter table", "create table", "create index" could have appeared on one side in development. The databases are very big (230'000 tables), so what is the best tool to find out all changes that appeared over time ? Thanks a lot ! ------------------------------ Gerd Kaluzinski ------------------------------ #Informix
Gerd:
In my utils2_ak utilities package which you can download from my web site (
www.askdbmgt.com
) is a script, mydbdiff, which will compare two databases or compare a database's current schema to a saved copy of the schema (saved from a previous run):
$ mydbdiff
Usage: mydbdiff [options] database1 [database2]
Options: [-sn] [-ddiffer] [-Ppager] [-S<1|2|3>] [-f sfile]-h - Print this usage and exit.
-s - Use sdiff instead of diff. Shorthand for '-d sdiff'
-n - Do not paginate output.
-d - Specify diff utility to use.
-P - Specify a pager other than $PAGER (PAGER=).
-S - Save schema for 1-first, 2-second, 3-both databases.
Saved files can be passed with -f for change tracking. -f - Compare database1 to schema saved in sfile.
Either two databases must be specified or one database and a file must be specified using the -f sfile option. To compare two sfiles just use diff.
Using the -d option you can specify what 'differ' you want to use, ex: diff, sdiff, etc. or to add options to the diff (ex: -d 'diff --ignore-all-space' ). You can also use the -P option specify what pager to use for the output or to redirect the output to disk (ex: -P 'cat >diff.file' or 'tee diff.file' )
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog:
http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
Thank You very much ! That helps a lot Mit freundlichen Grüßen / Kind regards Gerd Kaluzinski Certified IT-Specialist INFORMIX und DB2 UDB IBM Software Group, Information Management / SWG-Services-Info.Mgmnt. ------------------------------ IBM Deutschland Hollerithstr. 1 81829 München Phone: +49-175-228 1983 E-Mail: gerd.kaluzinski@de.ibm.com ------------------------------ IBM Deutschland GmbH / Vorsitzender des Aufsichtsrats: Sebastian Krause Geschäftsführung: Gregor Pillen (Vorsitzender), Agnes Heftberger, Norbert Janzen, Markus Koerner, Christian Noll, Nicole Reimer Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB 14562 / WEEE-Reg.-Nr. DE 99369940