Let's review the first compare method (by table). We provide the table list in the configuration file, it is not so convenient if we have a lot of tables need to be compared. Usually we need to compare all the tables with the same name across multiple databases, I will introduce a wild char to replace the table list, this utility will find out the tables which reside on all the databases, and perform the comparation.
Take a look at the following configuration file, it will compare all the tables which resides on both the databases.
TABLE: anysql/anysql@prod, scott/tiger@test | *
There are totally 4 tables which reside on both the databases. Let's check the compare log file.
Comparing structure by TABLE BONUS ...
Comparing structure by TABLE DEPT ...
Comparing structure by TABLE EMP ...
[MISMATCH] ENAME VARCHAR2(20) :
scott@test
[MISMATCH] ENAME VARCHAR2(30) :
anysql@prod
[MISSING ] COL_TEST :
anysql@prod
Comparing structure by TABLE SALGRADE ...
The wild char make this script more useful. By this utility, I identified out a lot of inconsistent tables in our system, and got very good feedbacks from my leaders.