>>-cdr define repair--+-------------------------+----job--------> | (1) | '-| Connect Option |------' >--+- --replicate=replicate-+-----------------------------------> '- --replset=repl_set----' >--+--------------------------------+---------------------------> '- --extratargetrows=-+-delete-+-' +-keep---+ '-merge--' >--4 --syncdatasource4=4data_server--+-------------------+---------> '- --blocksize=size-' >--+- --filter--source_participant--source_modifier--target_participant--target_modifier-+->< '-target_server-----------------------------------------------------------------------'
Element | Purpose | Restrictions | Syntax |
---|---|---|---|
data_server | The database server to use a reference copy of the data | The database server must be currently active in Enterprise Replication. | Long Identifiers |
job | Name of the repair job | Long Identifiers | |
replicate | Name of the replicate | The replicate must exist. | Long Identifiers |
repl_set | Name of the replicate set | The replicate set must exist. | Long Identifiers |
size | The number of user table rows to process together during a repair | Must be a positive integer | |
source_modifier | Specifies the rows and columns on the source server to use as the basis of the repair | The WHERE clause must select the same columns on both the source and target servers. Use key columns or columns with static values. | Participant Modifier |
source_participant | Name of the participant on the source server to use as the basis of the repair | The participant must exist in the specified replicate. The P, R, O, and I options are ignored. | Participant |
target_modifier | Specifies the rows and columns to repair on the target server | The WHERE clause must select the same columns on both the source and target servers. Use key columns or columns with static values. | Participant Modifier |
target_participant | Name of the participant to repair | The participant must exist in the specified replicate. The P, R, O, and I options are ignored. | Participant |
target_server | The database server on which the data is updated | The database server must be currently active in Enterprise Replication. | Long Identifiers |
The following table describes the cdr define repair options.
Use the cdr define repair command to define a repair job to repair inconsistent data between two Enterprise Replication servers. You can choose the level of granularity for the job by specifying the whole participant, or a specific portion of it defined by a SELECT statement.
While defining repair job, the Enterprise Replication network connection must be active between the Connect server, the reference server, and the target servers. The server specified in the Connect Option must be a non-leaf server.
To start the repair job, use the cdr start repair command.
You can only use a specific repair job one time.
The following example defines a repair job, repair_1, on the server utah for a specified portion of the participant:
cdr define repair repair_1\ --replicate=rep1 --syncdatasource=iowa\ --extratargetrows=delete\ --filter "db2@iowa.carlo.table2" \ "SELECT * FROM table2 WHERE customerid BETWEEN 100 AND 200" \ "db2@utah.carlo.table2" \ "SELECT * FROM table2 WHERE customerid BETWEEN 100 AND 200"
Line 2 of this example indicates that the replicate to repair is named rep1 and that the synchronization data source server containing the correct data is iowa.
Line 3 indicates that if there are rows on the target server, utah, that are not present on the synchronization data server (iowa) then those rows are deleted during the repair job.
Lines 4 through 7 show that the specific rows to repair on the utah server are those that have a customerid between 100 and 200.
The following example starts a repair job, repair_2, on the server utah for the whole participant:
cdr define repair repair_2\ --replicate=rep1 --syncdatasource=iowa\ --extratargetrows=keep \ utah
Line 3 of this example indicates that if rows are found on the utah server that do not exist on the iowa server, then those rows should remain.
Line 4 indicates that the target server is utah.