Checking Consistency and Repairing Inconsistent Rows

A consistency check compares the data between a reference server and one or more target servers and then generates a report that describes any inconsistencies. You can choose to repair inconsistent rows during a consistency check.

Before you begin

The following conditions apply when you check consistency:
  • Running a consistency check can consume a large amount of space in your log files. Ensure you have sufficient space before checking consistency.
  • The Enterprise Replication network connection must be active between the Connect server, reference server and the target servers while performing consistency checking and repair.
  • The replicate must not be in a suspended or stopped state during consistency checking.
  • The replicate must not be set up for time based replication.

About this task

You can perform a consistency check and optional synchronization on a single replicate or a replicate set. When you synchronize a replicate set, Enterprise Replication synchronizes tables in an order that preserves referential integrity constraints (for example, child tables are synchronized after parent tables). You can choose how to handle extra target rows and whether to enable trigger firing on target servers.

To perform a consistency check, use the cdr check replicate or cdr check replicateset command. Use the --repair option to repair the inconsistent rows. A consistency report is displayed for your review.

You can monitor the progress of a consistency check with the cdr stats check command if you provide a progress report task name in the cdr check replicate or cdr check replicateset command.

You can run a consistency check as a background operation as an SQL administration API command if you include the --background option. This option is useful if you want to schedule regular consistency checks with the Scheduler. If you run a consistency check in the background, provide a name for the progress report task by using the --name option so that you can monitor the check with the cdr stats check command. You can also view the command and its results in the command_history table in the sysadmin database. If you use the --background option as a DBSA, you must have CONNECT privilege on the sysadmin database and INSERT privilege on the ph_task table.

Results

If synchronization during a consistency check cannot repair a row, the inconsistent row is recorded in an ATS or RIS file.