4 4 44>>-cdr check replicateset--+-------------------------+----------> 4 | (1) | 4 '-| Connect Option |------' 4 4>-- --master=data_server-- --replset=repl_name------------------> 4 4 .---------------. 4 V | 4>--+---target_server-+-+--+------------+------------------------> 4 '- --all------------' '- --verbose-' 4 4>--+------------------------------------------------+---------->< 4 '- --repair--+---------------------------------+-' 4 '- --extratargetrows=--+-delete-+-' 4 +-keep---+ 4 '-merge--' 4
Element | 4Purpose | 4Restrictions | 4Syntax | 4
---|---|---|---|
data_server | 4Name of the database server to use as the reference copy 4of the data | 4Must be the name of an existing database server group in 4SQLHOSTS. See Setting up Database Server 4Groups. | 4Long Identifiers | 4
repl_set | 4Name of the replicate set to synchronize | 44 | Long Identifiers | 4
target_server | 4Name of a database server group to check | 4Must be the name of an existing database server group in 4SQLHOSTS. See Setting up Database Server 4Groups. | 4Long Identifiers | 4
The following table describes the cdr check replicateset options.
4 44Use the cdr check replicateset command to check the 4consistency of data between multiple database servers for a replicate set. 4The cdr check replicateset command compares all rows 4on all specified database servers against the data in the reference server 4and produces a consistency report. If you include the –verbose option, the report lists every inconsistent row; otherwise, the report 4summarizes inconsistent rows. If you include the –repair option, the cdr check replicateset command repairs 4inconsistent rows so that they match the rows on the reference server. During 4a repair of inconsistent rows, the cdr check replicateset command uses direct synchronization as a foreground process.
4The cdr check replicateset command requires that 4its associated user-defined routines are installed and registered in 4each database that is involved in the checking process. For instructions about 4installing and registering these routines, see Preparing the checksum 4Support Functions.
4The following command generates a consistency report for a replicate set 4named replset1, comparing the data on the server serv2 with the data on the server serv1:
4cdr check replicateset --master g_serv1 --replset=replset_1 g_serv24
The summary consistency report for the previous command might be:
4------ Statistics for repl1 ------ 4Node Rows Extra Missing Mismatch Processed 4---------------- --------- --------- --------- --------- --------- 4g_serv1 52 0 0 0 0 4g_serv2 52 0 0 0 0 4 4------ Statistics for repl2 ------ 4Node Rows Extra Missing Mismatch Processed 4---------------- --------- --------- --------- --------- --------- 4g_serv1 48 0 0 0 0 4g_serv2 48 0 0 0 04
This report indicates that the replicate set is consistent on these servers.
4The consistency report for replicate sets shows a series of consistency 4reports for individual replicates. For more examples of consistency reports 4and a description of the report, see the examples in cdr check replicate.
4