Closed maxsatula closed 8 years ago
Seems to be an Oracle bug, not a program bug. First portion is ok. Second read by UTL_FILE.GET_RAW looses a first byte of the source stream.
Happens only when the SERVER=SHARED. When SERVER=DEDICATED, all is ok.
Possible solutions: 1) Do nothing, document that ocp works with DEDICATED servers only. 2) Check server type (v$session or USERENV if possible) and apply a workaround if necessary (read first portion, close file, reopen file, read first portion less one byte and throw result away, then continue as usual) 3) Try to open file and reproduce the bug with a smaller buffer size, then close the file and start copy with knowledge whether workaround is needed. If the file is filled with the same byte, that does not work. Need to read entire file and check whether file size reduced by 1.
Using of SHARED server connection is impractical anyway. Even if there was not corruption, that might be extremely slow.
Downloaded file is 1 byte shorter than original and the data is different starting from position ORA_RAW_BUFFER_SIZE