GoldenGate uses reperror for error handling

Source: Internet
Author: User

When the Replicat process reports errors during DML operations, GoldenGate provides a parameter to control how to handle errors of the Replicat process. This is the reperror parameter to be introduced in this section. This parameter can control most GoldenGate error handling methods.

As shown in Replicat process parameter 1 in a case.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/2155363918-0.jpg "title =" 1.jpg"/>

Figure 1


1. reperror processing type and meaning

Reperror provides 7 error handling methods in GoldenGate11, as follows.

1) abend: When Replicat encounters a record that cannot be processed, it rolls back the transaction, stops processing, and changes the status of the Replicat process to abend.

2) discard: Place Error messages that cannot be processed into the discard file, while the Replicat process continues to process the following records.

3) exception: handle errors in a predefined manner.

4) ignore: ignore records that cannot be processed, and continue to process the following records.

5) retryop [maxretries <n>]: retries n times in case of a record that cannot be processed.

6) transabort [, maxretries <n>] [, delay [c] sesc <n>]; ends transaction processing and points rba at the beginning of the transaction, you can also specify the number of retries.

7) reset: Clear all reperror rules, and set the reperror rule to abend by default.

In the Replicat process parameters, you can set any processing type to the default value, such as reperror, default, and abend.

Generally, the default reperror rule is set to abend to ensure data consistency.


2. Common Database Error types and handling methods of replication processes

In the actual GoldenGate system, a large part of Replicat error messages are similar to database errors starting with ORA. Here we use Oracle database as an example ). Although, for ORA errors, You need to manually find the cause of the database, but you can use reperror to handle some unexpected error types, then find the cause of the error at the database level, and manually eliminate it, this process will not cause the process to process other normal tables but abend them.

For example, duplicate data insertion can be ignored, while other types of errors are reported as abend.

Example 11:

Reperror default, abend)

Reperror-1, ignore)

Of course, you can also ignore duplicate data insertion for a table and abend other types of errors.


Example 12:

REPERROR-1, IGNORE)

MAP sales. product, TARGET sales. product;

REPERROR RESET

MAP sales. account, TARGET sales. account;

The most common error is the ORA-1403.

1403 error indicates that the record cannot be delivered to the target database. It is a data error. You need to view the error information and the discard file, find the corresponding record in both databases, and analyze the actual data in the queue with logdump, analyze the cause of the problem. Possible causes include: inconsistent table structures at both ends; append log errors; inconsistent initialization method errors; cascading deletion at the target end, and trigger failure; the target end has Oracle job or operating system job to modify data.

Solution:

Reinitialize the table.

Manually repair the data.

Modify the reperror parameter to the discard or ignore mode. ignore the error. before using this parameter, you should be very clear about what you are doing, because it will cause data inconsistency between the two ends ).



3. Ddlerror handling DDL replication errors

When DDL replication is enabled for GoldenGate and an error is reported for DDL replication, you need to use the ddlerror parameter here to pre-process some common error messages. Ddlerror is valid for extraction and replication processes. The default value is abend.

The syntax of the Ddlerror parameter is:

Example 13:

DDLERROR

{<Error> | DEFAULT }{< response>}

[Retryop maxretries <n> [RETRYDELAY <delay>]

{INCLUDE <exclusion sion clause> | EXCLUDE <exclusion clause>}

[IGNOREMISSINGTABLES | ABENDONMISSINGTABLES]

For example, when DDL replication reports a ORA-1430 error that is caused by repeated alter statements, you can use ddlerror 1430, discard) to throw the error message to the discard file.

Other error handling methods are similar to reperror.


4. Discardfile records process error information

Use the discardfile parameter to generate a discard file and record information that cannot be processed by GoldenGate to this file. This is very helpful for the troubleshooting of GoldenGate.

If the structure of the table on the source side changes, an error is reported when the Replicat process is used for the data application passed by default. In this case, you can view the table with which the error information bit is used for the alter operation through the discard file, change the table structure at the target end to eliminate the error.

The Discard file is in the dirrpt sub-folder of the GoldenGate installation directory by default, as shown in 2.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/2155362R0-1.jpg "title =" 2.jpg"/>

Figure 2


The error message 3 in the Discard file record is shown in.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/21553AT7-2.jpg "title =" 3.jpg"/>

Figure 3

Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.