The Compare Objects tool is used to compare the definition of objects. It is mainly used to compare the definition of tables, however it has been configured to compare some other types of objects.
You run the Compare Objects tool from the Database Explorer using the compare icon on the Admin Toolbar. You will see this icon only if the Compare Objects function has been configured for your database and object.
The Compare Objects tool is part of the Extended Edition of AQT, which is a separately purchasable component of AQT. If you have not purchased the Extended Edition you can still use Compare Objects, however you will not be able to use the Compare all objects in schema option. Alternatively you may wish to use the "old" compare tables function that was part of AQT v6.
AQT can compare objects other than tables. The description below explains how Compare Objects works for tables.
This specifies the objects to be compared.
The What to Compare box shows you all the components that make up the definition of the table. These are:
Select or de-select components to specify what to include in the compare.
Each of these components is defined in AQT as a set of parameters. When you click on one of these components (in the left box) you will be shown these parameters in the Parameter for box:
In general you should not change the Parameter compare settings from the default values.
AQT can generate a report file that details the differences between the objects. This can be used as a useful summary of the differences.
When viewing the report file in Notepad it is recommended that a non-proportional font (such as Courier New or Fixedsys) is used. The information in the report file is aligned in particular columns, so will display better with these fonts.
This runs the Compare, and shows you the results on the Results tab. To cancel the compare, click on the Abort button (you may neeed to go back to the Options tab to do this).
These objects are difficult objects to compare, as they are generally defined by a block of text, such as a view or procedure definition. A "simple" compare of this text will show a difference when only a single byte is different; this can often happen due to differences in formatting such as extra blanks or linefeeds. To deal with this, AQT will unformat the text before comparing it. Unformatting the text will remove all linefeeds, tabs and extra blanks. By doing this, AQT is more able to deal with simple differences in the formatting of the definitions.
When you view the compare results, you will be shown the unformatted text in the compare results. This may be less readable than the original view / procedure definition, however is useful for seeing the difference between the definitions.
These are shown on the Results tab.
This window is divided into three parts, a top grid, and a left and right lower grids:
This shows you one row per table compared. For each row, there is a column in the grid showing you how each Component of the table compares. These correspond to the components selected in the What to Compare box in the Options tab.
Shows details of the item highlighted in the top grid.
In the example of indexes:
When comparing a related object (such as an index), Compare Objects will get the list of all indexes for the two tables. It will then go through these lists of indexes to determine which indexes "match" (eg. are the "same" index in both tables) and which indexes do not "match" (eg. are defined in one table but not the other).
The key to this matching process is the compare parameters. These are the parameters which are used to determine whether two objects are "the same". For instance, when we compare the indexes from two tables, we look at the index-columns - if these are the same then the two indexes are "the same".
The following table shows how some common objects are compared:
Object |
Compare Parameters |
Parameters Compared |
Parameters Not Compared |
Index |
index columns |
type (unique/non-unique) |
table name, index name |
Foreign Key |
referenced table, fk columns, referenced columns |
update rule, delete rule |
constraint name |
Primary Key |
pk columns |
|
|
Check Constraint |
constraint text |
|
constraint name |
AQT can compare objects across different database types (eg. Oracle to SQL Server). In this case:
AQT's Compare between different databases is good but not perfect. There are many small differences between databases that are difficult for the Compare Objects to deal with.
There is a known problem when comparing databases which have different collation orders. This can apply when comparing (for instance) DB2 z/OS tables to a tables in a non-DB2 z/OS platform.
AQT obtains the list of tables to compare by running a query such as select name from systables order by 1. However if your table names contain numbers, this list of table can be returned in different orders. This will cause the AQT object compare function to think that the some tables exist on one system but not the other (and vica-versa), when in fact they exist on both systems.
At this stage we do not have a resolution to this problem.