cdr repair

The cdr repair command synchronizes data based on ATS or RIS files.

Syntax


1  cdr repair
1  --check
2.1!  --verbose
2.1  --quiet
1  ats ats_file
1  ris ris_file
Element Purpose Restrictions Syntax
ats_file Name of the file for Aborted Transaction Spooling. Must be a full path name and file name. The path for the directory can be no longer than 256 bytes.

The file must be in text format; it cannot be in XML format.

Follows naming conventions on your operating system.
ris_file Name of the file for Row Information Spooling. Must be a full path name and file name. The path for the directory can be no longer than 256 characters.

The file must be in text format; it cannot be in XML format.

Follows naming conventions on your operating system.

The following table describes the option to cdr repair.

Long Form Short Form Meaning
--check -C Check the consistency between the database server and the ATS or RIS file. Display repair operations to stderr, but do not perform the repair operations.

In an active system, operations displayed with this option will not necessarily match those performed later during an actual repair.

--quiet -q Quiet mode. Repair operations are not displayed to stderr.
--verbose -v Verbose mode (default). All repair operations are displayed to stderr.

Usage

The cdr repair command reconciles rows that failed to be applied based on the information in the specified ATS or RIS file. If a row exists on the source database server, it is replicated again. If a row does not exist on the source database server, but does exist on the target server, then it is deleted from the target database server. By default, each of the repair operations is displayed to stderr.

If you are running this command as a DBSA, you must have read permission on the ATS and RIS files. Permissions on ATS and RIS files can be set with the chown operating system command.

The ATS or RIS file you specify in the cdr repair command must be in text format, which is the default format. You cannot specify the XML format of an ATS or RIS in the cdr repair command.

Before you run a repair, preview the repair to make sure the operations that would be performed are correct. To preview the repair operations, use the check option. All repair operations are displayed to stderr, but not performed. In an active system, however, the operations displayed by the ;check option might not be the same as the operations performed when you later run the repair.

The server on which you run the cdr repair command must have a copy of the ATS or RIS file and be able to connect to the source and target database servers involved in the failed transaction. In a hierarchical routing environment where the source and target database servers are not directly connected you might need to run the cdr repair command from an intermediate server. If necessary, copy the ATS or RIS file to the intermediate server.

ATS and RIS files do not include code set information, therefore, the code sets associated with the locales specified by the DB_LOCALE and CLIENT_LOCALE environment variables must be the same.

You can run this command from within an SQL statement by using the SQL administration API.

Note: The cdr repair command is not supported for replicates that are defined with the --UTF8=y option. For replicates that are defined with the --UTF8=y option, use the cdr check replicate --repair or cdr check replicateset --repair command to repair data.

Examples

The following example repairs inconsistencies between the g_beijing and g_amsterdam servers resulting from an aborted transaction:
% cdr repair ats ats.g_beijing.g_amsterdam.D_2.070827_12:58:55.1
Attempting connection to syscdr@amsterdam...
Using syscdr@amsterdam.
Source ID:10 / Name:g_amsterdam
Target ID:20 / Name:g_beijing
(1) [s = "1"]: Row will be updated on the source for replicate <655361>
(2) [s = "2"]: Row not found on the source for replicate <655361>
(2) [s = "2"]: Row not found on the target for replicate <655361>
(2) [s = "2"]: No operation will be performed.
(3) [s = "3"]: Row will be updated on the source for replicate <655361>
(4) [s = "4"]: Row will be updated on the source for replicate <655361>
(5) [s = "5"]: Row will be updated on the source for replicate <655361>
(6) [s8 = "1911"]: Row will be updated on the source for replicate <655362>
(7) [s8 = "1912"]: Row will be updated on the source for replicate <655362>
(8) [s8 = "1913"]: Row will be updated on the source for replicate <655362>
(9) [s8 = "1914"]: Row will be updated on the source for replicate <655362>
(10) [s8 = "1915"]: Row will be updated on the source for replicate <655362>