I try to read the same Oracle external table multiple times with the different underlying file content.
I use the java app with the code fragment like:
int sptepn = 1;
for (File file: files) {
log_step(stepn++);
copy_file_to_oracle_directory(file); // copy myfileN.txt to myfile.txt
call_oracle_sp_read_file();
}
In the pl/sql procedure I use code fragment like:
procedure read_file() is
cursor ext_cu is
select * from ext_table;
begin
for ext_rec in ext_cu loop
-- do something with ext_rec.*
end loop;
end read_file;
On the one group of db-servers this pl/sql procedure works properly. But on the other group of db-servers the call of this pl/sql procedure on the step 2 (of the java procedure) raises the error:
29913-ORA-29913: error in executing ODCIEXTTABLEFETCH callout: ORA-29400: data cartridge error: KUP-05011: Size of file myfile.txt in directory /mydir has changed from 12345 to 67890.
Where the myfile1.txt has the size 12345 and the myfile2.txt has the size 67890.
What is the problem?
The affected server has the version:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
PL/SQL Release 12.2.0.1.0 - Production
"CORE 12.2.0.1.0 Production"
TNS for IBM/AIX RISC System/6000: Version 12.2.0.1.0 - Production
NLSRTL Version 12.2.0.1.0 - Production