Replicating data? Let's make sure we keep it in sync.

Using SharePlex’s Compare and Repair Utility

When replicating data, it is important to make sure that your data stays in sync over time.  Out-Of-Sync (OOS) conditions can cause problems with your application, reports, and even compliance SLA’s.

There are a lot of reasons for replication, as shown in the graphic below.  All of these scenarios can be critical to the success of your organization and in any of these scenarios having an OOS condition could:

  • cause you to make business decisions based on wrong or incomplete data that causes bad financial decisions that could cost money
  • cause application downtime where your business cannot generate revenue and possibly cause you to miss your SLA’s
  • cause you to miss a deadline or filing requirement which may result in fines and penalties

To help manage potential OOS conditions SharePlex supplies a Compare and Repair utility as part of the software package.  There is no need to purchase any additional add-ons. 

When you are actively replicating, the Post process will detect OOS conditions for the rows that it is processing but there can be hidden out-of-sync conditions.

Examples of a hidden out-of-sync are:

  • DML applied on the target and not the source,
  • An incomplete backup restore.

These conditions can go undetected until Post applies an operation that affects the OOS row.

This is where Compare and Repair can help. When an OOS condition is found SharePlex provides the following commands for comparing and repairing out-of-sync data:

  • compare: Compares an individual source table to its target table or compares a wild carded set of tables in the same schema.
  • compare using: Takes input from a file to compare some or all of the tables in the active replication configuration.
  • repair: Repairs an individual target table or a wild carded set of tables in the same schema.
  • repair using: Takes input from a file to repair some or all of the tables in the active replication configuration.

The compare and repair commands are always issued on the source system and the tables that you want to compare or repair must be part of an active configuration file.

The command spawns a server process on the source system and then sends a message through the SharePlex queues to spawn a client process on the target system.

The server and client processes then begin communication with each other.  The two processes compare the source and target tables and then write the results to a log file. They also write the SQL that is needed to repair any out-of-sync rows to a SQL file in the same location as the log files.

If only a compare command is issued, SharePlex does not execute these SQL statements.

If a repair command is issued, the command works identically to the compare commands except that it executes the SQL statements to repair the out-of-sync rows.

By using these logfiles and sql scripts you can document the changes to your environment and stay within your compliance requirements.


In conclusion, the Compare and Repair utility, an integral part of SharePlex, allows you to make sure your replicated data is always accurate. 

This gives you peace-of-mind that your High Availability data is accurate, you are following your internal and external compliance requirements, and that you now have a complete system of validated and accurate data regardless of the need.

You can find more information about Compare and Repair by visiting our SharePlex documents library and


-Mark Kurtz