This page explains what happens between “Run” and the report. It helps you to read the numbers of the report, to choose the settings of a task and to find out why a row is reported. The steps in the Web UI are in Compare Data, the commands are described in the other pages of this section.
A comparison does not copy data from one database to the other. The Repstance server reads the rows of the Source Database and, later, the rows of the Target Database, turns every row into a hash (a short fingerprint of its values) and compares the two hashes. The rows themselves are not stored: only the keys and the hashes are saved, in a file on the Repstance server.
Three parts of Repstance take part:
The compare process is a separate process, but it is integrated with the Capture Process. This is why the Capture Process and the Apply Process have to be running while a task runs.
Rows per Chunk (the parameter chunk) is the number of the rows that are read at a time, 10000 by default. Data Validation % (the parameter deep) is the share of the rows of every chunk that is compared, from 1 to 100, 10 by default.
With less than 100 % the compare process compares the last rows of every chunk in the order of the key. With 10 % and a chunk of 10000 rows these are the 1000 rows with the highest keys, and in a table of 105 rows the last 11 rows (the number is rounded). The other rows of the chunk are not compared. Only 100 % compares every row.
What follows from it:
The value of every column that is compared is converted to a text that does not depend on the database. The texts of the columns are joined with a comma and the MD5 hash of the result is the hash of the row. An empty value, NULL or an empty string, is written as N. The same conversion is made in the Source Database and in the Target Database. The conversions of the data types are listed in Requirements and Limits.
The functions of a task (the parameters mapcols and maptypes, “Add f(x)” and Map Types in the Web UI) work on the converted text, not on the original value. They are used in the queries of both databases.
The hash is made of the exact text, so the comparison is case sensitive and accent sensitive whatever the collation of the databases is, and a blank at the beginning of a value matters. A blank at the end of a character value does not.
Incremental. The compare process does not read the table. It takes the keys of the rows that have changed since the previous run of the table from the trail files of the Capture Process, reads these rows from the Source Database (all of them, there is no sampling) and goes on as for a chunk. The trail files have to exist, see Start/Stop Task.
Repair. The compare process writes the keys of the failed and the missed rows of the last run into a load configuration. The Capture Process reloads these rows from the Source Database, the Apply Process merges them into the Target Database by the key (a missing row is inserted, a row that differs is updated, no row is deleted) and the compare process compares the keys once more. The steps and the limits are in Start/Stop Task.
| What | Where |
|---|---|
| The definition of a task: the tables, the settings, the functions | A file in the conf folder of the Repstance server, named after the task and the id of the Capture Process. |
| The state of every table of a task: the status, the chunks that are done, the position, the time of the start | The table repi.ValidateTables in the Source Database. It is replicated to the Target Database like a table of the user. |
| The keys and the hashes of the chunks that the Apply Process has not compared yet | Files in the folder trail/{capture name}/{task name} of the Repstance server. The Apply Process removes a file when it has compared it. |
| The results: the counts, a sample of up to 50 keys of the failed rows and of the missed rows, and the complete list of the keys for the repair | Files with .hashdone in the name in the same folder, a set for every Apply Process. |
Deleting a task removes its rows in repi.ValidateTables, its folder under trail and its file in conf. Do not remove these files by hand.
If several Apply Processes read from the Capture Process, for example for two Target Databases, each of them compares the hashes with its own Target Database. A file of hashes is kept until every one of them has compared it, and the report shows the result for each Apply Process.
The compare process does not wait for the Apply Process. It reads chunk after chunk, and the number of the chunks that it has read (the column Capture of the report) runs ahead of the number that the Apply Process has compared (the column Apply). The files of the chunks wait in the trail folder until the Apply Process has compared them, so a stopped or a slow Apply Process lets them pile up. Watch the disk space of the server when you compare a big table with Data Validation % 100, and start the Apply Process before the task.
Prev page:
DATA COMPARISONNext page:
Requirements and Limits