Saturday, March 24, 2012

Oracle GoldenGate : Numcnv_getnumeric - Buffer Overflow When Using Filter "Where" in a Table Statement.

Numcnv_getnumeric - Buffer Overflow When Using Filter "Where" in a Table Statement.

Oracle GoldenGate - Version: 11.1.1 or later


Problem Statement:

Oracle GoldenGate (OGG) extract abends with the following error when using Filter on a numeric column


ERROR OGG-01072 NUMCNV_getNumeric(const char *, size_t, int64_t *, short *, BOOL): Buffer overflow, needed: 21, allocated: 19

The issue happens when using a filter clause against a numeric column if the column length is more than 19 digits. For example:


Extract param file:


EXTRACT ea021
EXTTRAIL ./dirdat/mm
userid ogg, password XXXX
TABLE OGGUSER.LONGTEST, FILTER (ROLLCALL > 0) ;



CREATE TABLE STATEMENT:

CREATE TABLE "LONGTEST"
( "ROLLCALL" NUMBER(31,0),
"NAME" VARCHAR2(43),
PRIMARY KEY ("ROLLCALL")
);



SAMPLE TABLE STATEMENT:

insert into OGGUSER.LONGTEST values (12345678909999999990,'Fredie');
commit;



The extract abend with the error

2012-03-24 18:06:53 ERROR OGG-01072 Oracle GoldenGate Capture for Oracle, ea021.prm: NUMCNV_getNumeric: Buffer overflow, needed: 112, allocated: 19.



Avoiding the error:
If the filter was removed, the extract would capture the record without any problems.
If a record is inserted with column length 18 or less, the filter will work fine.


REASON:

Numeric conversion code throws the above error when an input string that is greater than 19 digits. Here, scale is 0 and the value passed in has a length of 20. Hence digits will be 20. int64_t does not support such big numbers. This occurs when trying to evaluate the filter.
Without the filter, the function is not called to convert to numeric.



SOLUTION:

The solution will be implemented in OGG v12.1.

The workaround is to avoid using the filter for a column which might have more than 19 digits in its input string.

BUG REFERENCE (From metalink):

BUG:13087646 - EXTRACT ABEND WITH NUMCNV_GETNUMERIC WHEN USING FILTER

No comments:

Post a Comment