Home | Previous Page | Next Page   Appendix A. Command-Line Utility Reference >

cdr define repair

The cdr define repair command defines a repair job.

Syntax

Read syntax diagramSkip visual syntax diagram>>-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-----------------------------------------------------------------------'
 
Notes:
  1. See page Connect Option.
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.

Long Form Short Form Meaning
--blocksize= -b Specifies the number of user table rows to process together during a repair. Set this option to a lower number to increase concurrency. If not set, then the blocksize is calculated internally depending on the primary key size of the table being repaired.
--extratargetrows= -e Specifies how to handle rows found on the target servers that are not present on the data source server (data_server):
  • delete: (default) remove rows and dependent rows, based on referential integrity constraints, from the target servers
  • keep: retain rows on the target server
  • merge: retain rows on the target server and replicate them to the data source server
--filter -f Specifies the job uses a filter to choose which columns to repair. This option requires a participant and modifier from both the source and target servers. The WHERE clauses in the modifiers must select the same set of rows on both the source and target servers. In the WHERE clauses, only reference columns that are exactly the same on the source and target nodes, and only columns that are not updated.
--replicate= -r Specifies the name of the replicate on which to perform the repair job.
--replset= -R Specifies the name of the replicate set on which to perform the repair job.
--syncdatasource= -S Specifies the name of the database server to use as the reference copy of the data.

Usage

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.

Examples

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.

See Also

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]