Site Map Contact Us Home
E-mail Newsletter
Subscribe to get informed about
Clever Components news.

Your Name:
Your Email:
 
SUBSCRIBE
 
Previous Newsletters
 






Products Articles Downloads Order Support
Customer Portal      

Database Comparer VCL Tour

Compare databases using direct connection to the databases

This method can be used when both Master and Target databases are online.

Please see the diagram and the detailed comments below. This diagram shows how to compare and update two Interbase databases. You can connect to any other supported database (MS SQL, Oracle, MySQL, Sybase, PostgreSQL, dBASE or Paradox) using the corresponding TDBCConnectionXXX component.

TIBDatabase component from IBExpress library provides connection to the Master and Target databases respectively.

TDBCConnectionIBX component connects to the Interbase database using the IBExpress database engine.

TIBDBExtract component connects to the database via TDBCConnectionIBX, extracts all metadata from it and then feels given TDBStructure component with the database structure descriptions.

TDBStructure component stores the database structure.

TDBComparer component analyzes structures of both Master and Target databases stored within the TDBStructure components and generates the resulting update script. The update script is just a regular DDL/SQL script which after being applied to the Target database makes its structure identical to the Master database.

Update script can be saved to a file for later use and then executed with any SQL tool.

TIBSQLExec component can take the update script generated by the TDBComparer component and run it against the Target database. Given script will be executed by TIBSQLExec component on "statement by statement" basis and thus all errors which may occur during the Target database structure conversion will be detected and properly resolved.

Compare database DDL scripts

This method can be used when only DDL/SQL scripts of Master and Target databases are available.

Please see the diagram and the detailed comments below.

TIBScriptExtract component reads and parses the DDL/SQL script, extracts all metadata and then feels given TDBStructure component with the database structure descriptions.

TDBStructure component stores the database structure.

TDBComparer component analyzes structures of both Master and Target databases stored within both TDBStructure components and generates the resulting update script. The update script is just a regular DDL/SQL script which after being applied to the Target database makes its structure identical to the Master database.

Update script can be saved to a file for later use and then executed with any SQL tool.

Compare databases using direct connection and DDL script

This method is basically the combination of the Compare databases using direct connection to the databases  and Compare database DDL scripts methods.

The diagram below shows how you can update the Target database structure using the Master DDL/SQL script loaded from a file.

Compare Table data

Please use the TTableDataComparer component if you want to synchronize data in database tables. The following diagram shows how to set-up this component for synchronizing two database tables.

 

TIBDatabase component from IBExpress library provides connection to the Master and Target databases respectively.

TDBCConnectionIBX component connects to the Interbase database using the IBExpress database engine.

TTableDataComparer component compares and synchronizes table records between two Interbase databases. Please use a set of TDBCConnectionXXX components for connecting to any other supported database (MSSQ, Oracle, MySQL, Sybase...).

Synchronize multiple databases

Let's say you have number of Target databases all with different structures and these databases needs to be synchronized with the Master database.

In this case you need to extract the Master database metadata into a DDL/SQL script file and then compare all Target databases against this Master script.

This is the most suitable for version control applications and for updating client (Target) databases using only Master DDL/SQL script, without bringing whole Master database.

    Copyright © 2000-2024