Product Documentation

c-treeACE V11.0 Update Guide

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

Previous Topic

Next Topic

Rollback to New Restore Points with ctrdmp

In V11 and later, ctrdmp is able to rollback to a Restore Point. Restore Points permit server clients to establish quiet spots in the transaction log where there are no active transactions.

Prior to the V11 modifications, ctrdmp could either perform a dynamic dump recovery or rollback to a specified date and time. ctrdmp has been extended such that, as an alternative to specifying a date and time, the rollback script can provide the name of a Restore Point file.

A typical ctrdmp script file used for a rollback looks like:


!ROLLBACK

!DATE MM/DD/YYYY

!TIME HH:MM:SS

....

Now the script can be composed as follows:


!RP <Restore Point File Name>

....

The Restore Point File Name generated by the server is either of the following:

  • RSTPNT_NO_CHK.YYYYMMDD_HHMMSS.FCS for a Lightweight Restore Point
  • RSTPNT_CHKPNT.YYYYMMDD_HHMMSS.FCS for a Checkpoint Restore Point

Note that, as with the !ROLLBACK script keyword, the !RP keyword must be the first entry in the script file.

See also

TOCIndex