Compare index structure difference between tables

Links: http://www.dbatools.net/mytools/compare_column_and_index.html

    I will introduce you how to compare index structure between tables with the compare any column utility (Overview / Download). I fixed the table structure difference found in previous case, and create the following indexes for demo.

CREATE INDEX IDX_SALES_CN1 ON SALES_CN (COL1);
CREATE INDEX IDX_SALES_US2 ON SALES_US (COL3);
CREATE INDEX IDX_SALES_OTHER1 ON SALES_OTHER (COL1);

    Now we can run this utility with the following command with "-i" option.

companycol.pl -f all_demo.cfg -i

    Then check the screen output or check the log file generated (with "-l" option).

Comparing structure of tables on different hosts ...
Tables
       sales_cn         sales_us        sales_other
     [MISSING ] Index(COL3 ASC) :
               sales_cn!dbchina         sales_other!dbother
     [MISSING ] Index(COL1 ASC) :
               sales_us!dbus

    The indexes are not compared by name, actually columns and column orders are taken into account.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36