rs_subcmp enhancement

In Replication Server 15.0.1, rs_subcmp uses a hash algorithm to improve its performance. Hash algorithm compresses the data in primary and replicated tables. The compressed data is then fetched by rs_subcmp.

Instead of taking the entire row of data during comparison between the primary table and replicated table, rs_subcmp now transfers only the compressed data of each data row from the primary or replicated tables, and then verifies or reconciles inconsistencies between them.

With the hash algorithm, the amount of data to be transferred from the primary and replicated tables to rs_subcmp is reduced, decreasing the total running time of rs_subcmp.

New command line and configuration file parameters

Table 4-2 and Table 4-3 describe parameters that are new to rs_subcmp that support the use of the hash algorithm.

Table 4-2: New command line parameters for hash algorithm

Parameter

Description

-h

Perform faster comparison.

-H

Normalize data when using hash algorithm across different platforms or character sets.

Table 4-3: New configuration file parameters for hash algorithm

Parameter

Description

FASTCMP

The same as command line parameter -h. The syntax is: FASTCMP = Y|N Values are: Y – perform fast comparison using compressed data. N (default) – perform normal comparison as before.

HASH_OPTION

The same as command line parameter -H. The syntax is: HASH_OPTION = lsb | msb | unicode | unicode_lsb | unicode_msb If this parameter does not exist in the configuration file, by default, rs_subcmp uses the native byte order and character set.

Limitation

The enhanced rs_subcmp requires ASE 15.0.2 or later and cannot handle case sensitive comparison. It also cannot handle text, unitext, or image datatypes and does not allow you to specify the precision for the float datatype (maximum precision is used).

NoteSybase suggests to set the ASE parameter default data cache to 128M or higher to get a better comparison performance.

Example

Example 1 To instruct rs_subcmp to get the compressed data and reconcile any inconsistencies between the primary and replicated tables, enter:

rs_subcmp [-h] [...]

Example 2 To instruct rs_subcmp to normalize data when using hash algorithm, enter the following command, where options can be lsb, msb, unicode, unicode_lsb, and unicode_msb:

rs_subcmp [-h -H options] [...]

Table 4-4 describes the string options to use with rs_subcmp.

Table 4-4: rs_subcmp string options

Option

Description

lsb

All byte-order dependent data is normalized to lsb-first (little-endian) before data compression.

msb

All byte-order dependent data is normalized to msb-first (big-endian) byte order before data compression.

unicode

Character data is normalized to unicode (UTF-16) before data compression.

NoteUTF-16 string looks very much like an array of short integers and is byte- order dependent, thus Sybase suggests that you use lsb and msb in conjunction with unicode for platform independence. For example, use unicode_lsb or unicode_msb.

See Chapter 7, “Executable Programs” of the Replication Server Reference Manual, for more information on using these parameters with rs_subcmp.