Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctcompare - Database Comparison Tool

The Database Comparison utility, ctcompare is available in V11 and later. It allows you to compare two files (or two versions of the same file) or two tables. Options are provided that allow you to merge the differences into one of the files without affecting the other.

Usage:

ctcompare -s source -t target -n source name

[-u source uid][-U target uid]

[-p source pwd][-P target pwd][-N target name][-I name][-d]

[-b source dir][-B target dir]

Where:

  • -bB - base directory for session dictionary (only used with -d)
  • -d - interpret name as a database name (default is table name)
  • -s - source server name
  • -t - target server name
  • -u - source user name (default: admin)
  • -U - target user name (default: admin)
  • -p - source password
  • -P - target password
  • -n - source file name
  • -N - target file name (default is the source name)
  • -x - printf hex offsets
  • -I - Use r-tree symbolic index 'name' as record identifier

The following parameters are used to apply differences from the source to the target. The source will remain unchanged. When determining the differences between the two files, records are identified based on their unique keys.

  • -A1 - Apply all differences (deletes extra records from target)
  • -A2 - Apply only missing records
  • -A3 - Apply missing records and updates

Example 1

Compare two files named custmast.dat on different servers, log differences:

ctcompare -s FAIRCOMS@localhost -t FAIRCOMS@otherhost -n custmast.dat -u admin -p ADMIN

Example 2

Compare two versions of the same file, and merge all differences to custmast2:

ctcompare -s FAIRCOMS -t FAIRCOMS -n .\dir1\custmast.dat -N .\dir2\custmast2.dat -A1

Example 3

Compare all tables in two SQL/CTDB databases:

ctcompare -s FAIRCOMS -t FAIRCOMS@otherhost -n db1 -N db2 -d -u admin -p ADMIN

TOCIndex