Skip to Main Content
  • Questions
  • Unable to load the data in external table: KUP-04020: found record longer than buffer size supported, 524288

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Rajendra Prasad.

Asked: February 27, 2017 - 1:18 pm UTC

Last updated: February 28, 2017 - 3:13 pm UTC

Version: 11g

Viewed 10K+ times! This question is

You Asked

Hi,

I have a scenario, where I have to load the data into External table. I have the file with 677KB size and record delimiter for file is '^row^'

When i tried to load the data , i am getting below error.

ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04020: found record longer than buffer size supported, 524288,

Can any one help me on this?

My code is like :

(TYPE ORACLE_LOADER
DEFAULT DIRECTORY DEFAULT_DIR
ACCESS PARAMETERS
(RECORDS DELIMITED BY ''rOw^''
skip 1
NOLOGFILE
NOBADFILE
NODISCARDFILE
FIELDS TERMINATED BY ''^''
OPTIONALLY ENCLOSED BY ''"''
MISSING FIELD VALUES ARE NULL
)Code {...}

and Chris said...

I take you mean "read the data from a file into the DB using an external table"? Not write the data to an external table?

Assuming yes, Oracle Database controls the maximum amount of data it reads with the READSIZE parameter. This defaults to 524,288 (512K). So to get your records 677Kb in size, set to something larger like 1,048,576 (1Mb):

(TYPE ORACLE_LOADER
DEFAULT DIRECTORY DEFAULT_DIR
ACCESS PARAMETERS
(RECORDS DELIMITED BY ''rOw^''
readsize 1048576
skip 1
NOLOGFILE 
NOBADFILE
NODISCARDFILE
FIELDS TERMINATED BY ''^''
OPTIONALLY ENCLOSED BY ''"'' 
MISSING FIELD VALUES ARE NULL
)


http://docs.oracle.com/database/122/SUTIL/ORACLE_LOADER-access-driver.htm#SUTIL1399

Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Still i see the error being thrown

Rajendra Prasad Sindem, February 28, 2017 - 6:18 am UTC

I have added the read size limit as 1048576(1MB). But i still see the error being thrown.

ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04020: found record longer than buffer size supported, 1048576

Any thoughts on this ?
Chris Saxon
February 28, 2017 - 3:11 pm UTC

See the suggestions below.

few suggestions

Anonymous, February 28, 2017 - 10:05 am UTC

Hi

Have You checked how long records there actually are in the file ? Are they longer that 1 mb ?

You are quite sure about this string which is terminating the record ? Could it be so, that loader is now not recognizing end of record ?

Chris Saxon
February 28, 2017 - 3:11 pm UTC

Yep, thanks for the suggestions.

Rajendra Prasad Sindem, February 28, 2017 - 10:58 am UTC

I have validated the records on file. I don't see any of the record exceeding size limit of ! MB.
I was trying to execute this package code from Apex. When i run a procedure alone, data is being read and loaded into table. But when i am running it from Apex, i am getting the above error.

Chris Saxon
February 28, 2017 - 3:13 pm UTC

Are you sure the record terminator is correct?

For us to help further you're going to have to share your code, showing what works and what doesn't. And the external table definition and some failing records from the file.

unix2dos dos2unix

Joey Panoy, February 18, 2021 - 7:57 pm UTC

Had this same issue while loading the sample schema SH (sales history) in Oracle DB 12.2 for Windows.

The fix for me was to download and run unix2dos for all .dat .ctl .sql under .\sales_history\ folder.

re-run @sh_main.sql and all worked fine without the errors.