ORA-29285: file write error

Hi,
We are getting this error ORA-29285: file write error while writing to a text file using utl_file.putf package.
Using fopen funtion in code to open file as below:
V_FILEHANDLE:=UTL_FILE.FOPEN(v_file_path,'ABC','W', max_linesize);
Here max linesize = 32000, so as far as I think, limitation on length of records while writing the file is not an issue.
Further code is written as:
UTL_FILE.PUTF(V_FILEHANDLE, v_text1||'|'||v_text2||'|');
UTL_FILE.NEW_LINE(V_FILEHANDLE);
UTL_FILE.FFLUSH(V_FILEHANDLE); -- This is called after every 500 lines are written to the file.
UTL_FILE.FCLOSE(V_FILEHANDLE);
We are encountering this error every now and then, and strangely this gets resolved when we re-run the program and file gets written successfully.
Can someone please help on this please?
Oracle database 11g, version: 11.1.0.7.0
Thanks,
Sonam

Not enough information.
964643 wrote:
Hi,
We are getting this error ORA-29285: file write error while writing to a text file using utl_file.putf package.
Using fopen funtion in code to open file as below:
V_FILEHANDLE:=UTL_FILE.FOPEN(v_file_path,'ABC','W', max_linesize);And what value has v_file_path got? Is this the name of an Oracle Directory Object as it should be?
Here max linesize = 32000, so as far as I think, limitation on length of records while writing the file is not an issue.
Further code is written as:
UTL_FILE.PUTF(V_FILEHANDLE, v_text1||'|'||v_text2||'|');
UTL_FILE.NEW_LINE(V_FILEHANDLE);
UTL_FILE.FFLUSH(V_FILEHANDLE); -- This is called after every 500 lines are written to the file.
UTL_FILE.FCLOSE(V_FILEHANDLE);
We are encountering this error every now and then, and strangely this gets resolved when we re-run the program and file gets written successfully.
Can someone please help on this please?Not without seeing complete code so that we can try and reproduce the problem or spot where you may be going wrong.

Similar Messages

  • Encountering ORA-29285: file write error

    Hi. I am running a simple code and got this error? ORA-29285: file write error
    I swear this is working yesterday and and all my write to text code =(
    Error starting at line 1 in command:
    Declare
    v_file utl_file.file_type;
    v_dir_folder varchar (30) := 'DATA_PUMP_DIR';
    BEGIN
    v_file := UTL_FILE.FOPEN(v_dir_folder,'Test.txt','w');
    UTL_FILE.PUT_LINE(v_file, 'text1');
    UTL_FILE.FCLOSE(v_file);
    END;
    Error report:
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 77
    ORA-06512: at "SYS.UTL_FILE", line 690
    ORA-06512: at line 8
    29285. 00000 - "file write error"
    *Cause:    Failed to write to, flush, or close a file.
    *Action:   Verify that the file exists, that it is accessible, and that
    it is open in write or append mode.

    989873 wrote:
    Hi. I am running a simple code and got this error? ORA-29285: file write error
    I swear this is working yesterday and and all my write to text code =(
    Error starting at line 1 in command:
    Declare
    v_file utl_file.file_type;
    v_dir_folder varchar (30) := 'DATA_PUMP_DIR';
    BEGIN
    v_file := UTL_FILE.FOPEN(v_dir_folder,'Test.txt','w');
    UTL_FILE.PUT_LINE(v_file, 'text1');
    UTL_FILE.FCLOSE(v_file);
    END;
    Error report:
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 77
    ORA-06512: at "SYS.UTL_FILE", line 690
    ORA-06512: at line 8
    29285. 00000 - "file write error"
    *Cause:    Failed to write to, flush, or close a file.
    *Action:   Verify that the file exists, that it is accessible, and that
    it is open in write or append mode.Does "Test.txt" now exist?
    If so, which OS user owns this file?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • ORA-29284: File read error

    Good morning,
    Need to do two flat file on a 2000 lien.
    1 - Read a file. csv
    2 - Keep it plain, unformatted information from a table
    These are the steps I performed to achieve the first goal ...
    1 - READING TEST FILE
    CREATE OR REPLACE DIRECTORY PUBLIC_ACCESS AS 'C:\REPORTES_REY';
    GRANT READ, WRITE ON DIRECTORY PUBLIC_ACCESS TO PUBLIC;
    -- THIS PL / SQL works ok..
    DECLARE
    v1 utl_file.file_type;
    v2 varchar2(600);
    begin
    v1:= utl_file.fopen('PUBLIC_ACCESS','prueba20110218.csv','R'); -- WORKS WELL ...
    --v1:= utl_file.fopen('PUBLIC_ACCESS','sui_facturacion_alcantarillado_15085_2011_01_76845_001.csv','R');
    loop
         begin
              utl_file.get_line(v1,v2);
              dbms_output.put_line('el contenido del archivo es: '||v2);
              exception
              when no_data_found then
              exit;
         end;
              dbms_output.put_line(' - ');  JUMP LINE
    end loop;
         utl_file.fclose(v1);
    exception
         when others then
         dbms_output.put_line(sqlerrm);
    end;
    but when you change the file name by map prueba20110218.csv de-> sui_facturacion_alcantarillado_15085_2011_01_76845_001.csv displays the following error
    ORA-29284: File read error+
    - this error to be?
    I am grateful for the attention and cooperation extended ...
    good day ...
    REYNEL SALAZAR MARTÍNEZ
    Cali-Colombia

    Thank you very much for your cooperation extended
    The file if it exists, the operating system is Windows, I'm running for the line of command and the file is in the same direction as the file prueba20110218.csv
    Segi therefore his advice and remove:
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    then run the following code:
    DECLARE
    v1 utl_file.file_type;
    v2 varchar2(800);
    begin
    v1:= utl_file.fopen('PUBLIC_ACCESS','prueba20110218.csv','R'); FUNCIONA BIEN...+
    v1:= utl_file.fopen('PUBLIC_ACCESS','sui_facturacion_alcantarillado_15085_2011_01_76845_001.csv','R',32767);
    loop
    begin
    utl_file.get_line(v1,v2);
    dbms_output.put_line('el contenido del archivo es: '||v2);
    exception
    when no_data_found then
    exit;
    end;
    dbms_output.put_line(' - ');  SALTO DE LINEA+
    end loop;
    utl_file.fclose(v1);
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end;
    +/+
    ORA-06502: PL / SQL: error: character string buffer too small numeric or value
    I do not understand the error -> ORA-06502
    thanks...
    good day
    Reynel Salazar Martínez
    Cali-Colombia

  • Backup failed with tar file write error (10054)

    Hi
    I have got the issue with the online backup.
    Database: Oracle 9.2.0.7
    SAP : 4.7
    Backup Server: Netbackp
    When ever i trigger the backup on few of my SAP Servers, it runs for a while and then at a point just get struck.
    Where for other systems it is running fine.
    Error:
    Incident:1
    http://80.00 18:52:28 INF - Waiting for mount of media id A00201 on server mk2sapp001-b.
    http://80.00 18:53:42 INF - Beginning backup on server mk2sapp001-b of client mk1sap01-b.
    http://80.00 18:55:10 FTL - tar file write error (10054)
    Incident:2
    http://80.00 12:05:50 BKR - G:\oracle\VWD\sapdata1\btabd_41\
    http://80.00 12:05:53 INF - Beginning backup on server mk2sapp001-b of client mk1sap01-b.
    http://80.00 12:08:13 FTL - tar file write error (10054)
    http://80.00 12:08:13 INF - Client completed sending data for backup
    After the step mentioned in bold it just get struck,
    There is no issue with the space at OS level
    I can see all process will still be running in task manager
    such as backint.exe, brbackup.exe, brconnect.exe
    But
    I don't find bpbkar32.exe Process, after the backup got struck.
    I have asked Network guys as well and they said every thing is fine from their side(such as Speed, Full Duplex)
    Its very important, please assist.
    Thanks in advance

    yes , i am using symantec netbackup,
    but every thing is fine from their side as well(settings).
    i have reinstalled the client as well.
    it runs for 1 hr and then it throws error.
    yesterday i scheduled two backup at two different time(at the interval of 1 hr) but they both failed (struck) at the exact same time(even seconds were same).
    So what do you say??

  • Load blob to file. error: file write error

    Hi,
    I used procedure witch load blob to file. It's working at Oracle 10g, but its does't work on oracle 11g. Why?
    create or replace PROCEDURE load_blob_to_bfile (p_file_id IN VARCHAR2, p_directory IN VARCHAR2, p_ident in varchar2 default NULL)
    IS
    v_blob BLOB;
    v_start NUMBER := 1;
    v_bytelen NUMBER := 2000;
    v_len NUMBER;
    v_raw RAW (2000);
    v_x NUMBER;
    v_output UTL_FILE.file_type;
    v_file_name VARCHAR2 (200);
    BEGIN
    -- get length of blob
    SELECT DBMS_LOB.getlength (blob_content), filename
    INTO v_len, v_file_name
    FROM wwv_flow_files
    WHERE filename = p_file_id;
    -- define output directory
    v_output := UTL_FILE.fopen (p_directory, p_ident||'_'||v_file_name, 'wb', 32760);
    -- save blob length
    v_x := v_len;
    -- select blob into variable
    SELECT blob_content
    INTO v_blob
    FROM wwv_flow_files
    WHERE filename = p_file_id;
    v_start := 1;
    WHILE v_start < v_len AND v_bytelen > 0
    LOOP
    DBMS_LOB.READ (v_blob, v_bytelen, v_start, v_raw);
    UTL_FILE.put_raw (v_output, v_raw);
    UTL_FILE.fflush (v_output);
    /* Text only could be: UTL_RAW.cast_to_varchar2 (v_raw);*/
    -- set the start position for the next cut
    v_start := v_start + v_bytelen;
    -- set the end position if less than 32000 bytes
    v_x := v_x - v_bytelen;
    IF v_x < 2000
    THEN
    v_bytelen := v_x;
    END IF;
    END LOOP;
    UTL_FILE.fclose (v_output);
    END;
    directories is creaited and granted for read and write. It looks like file is created, but application rise the write file error, and files in directory is emty.
    TomasB

    So, I'm copying the file in a temp. BLOB with this function:
    FUNCTION get_remote_binary_data (p_conn IN OUT NOCOPY UTL_TCP.connection,
    p_file IN VARCHAR2)
    RETURN BLOB IS
    l_conn UTL_TCP.connection;
    l_amount PLS_INTEGER;
    l_buffer RAW(32767);
    l_data BLOB;
    BEGIN
    DBMS_LOB.createtemporary (lob_loc => l_data,
    CACHE => TRUE,
    dur => DBMS_LOB.CALL);
    l_conn := get_passive(p_conn); //get a passive connection
    send_command(p_conn, 'RETR ' || p_file, TRUE); //send Retrieve command to server
    BEGIN
    LOOP
    l_amount := UTL_TCP.read_raw (l_conn, l_buffer, 32767);
    DBMS_LOB.writeappend(l_data, l_amount, l_buffer);
    END LOOP;
    EXCEPTION
    WHEN UTL_TCP.END_OF_INPUT THEN
    NULL;
    WHEN OTHERS THEN
    NULL;
    END;
    UTL_TCP.close_connection(l_conn);
    get_reply(p_conn);
    RETURN l_data;
    END;
    Then I'm writing it into a local file:
    PROCEDURE put_local_binary_data (p_data IN BLOB,
    p_dir IN VARCHAR2,
    p_file IN VARCHAR2) IS
    l_out_file UTL_FILE.FILE_TYPE;
    l_buffer RAW(32767);
    l_amount BINARY_INTEGER;
    l_pos INTEGER := 1;
    l_blob_len INTEGER;
    BEGIN
    l_blob_len := DBMS_LOB.getlength(p_data);
    l_amount := DBMS_LOB.GETCHUNKSIZE(p_data);
    IF (l_amount >= 32767) THEN
    l_amount := 32767;
    END IF;
    l_out_file := UTL_FILE.FOPEN(p_dir, p_file, 'w', 32767);
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.READ (p_data, l_amount, l_pos, l_buffer);
    UTL_FILE.put_raw(l_out_file, l_buffer, FALSE);     
    l_pos := l_pos + l_amount;
    END LOOP;
    UTL_FILE.FCLOSE(l_out_file);
    EXCEPTION
    WHEN OTHERS THEN
    IF UTL_FILE.IS_OPEN(l_out_file) THEN
    UTL_FILE.FCLOSE(l_out_file);
    END IF;
    RAISE;
    END;
    I've checked the blob before I'we wrote it ito the file (UTL_FILE.put_raw(l_out_file, l_buffer, FALSE)), and it contains no carriage-return.

  • Intermittent report file write error in process model

    Hello,
    We have recently seen a couple errors we have not seen before, that are intermittent.   This occurs in the single pass entry point sequence, the first "write UUT report" step (the non-on-the-fly one).  The error message is as follows:
    "An error occurred calling 'Save' in 'Report' of 'NI TestStand API 4.0'
    A file with the pathname 'T:\HTC' already exists.. Error writing to file 'T:\HTC\WING\3WWE\StressTest.seq\StressTest_Report[NO_UUT_SERIAL_NUM13][3 23 37 PM][4 28 2008] - TS2.html'."
    So when breaking here, and looking at Locals.ReportFilePath (which is the pointed to variable in the specifiy module of this step), it was indeed defined as:
    T:\HTC\WING\3WWE\StressTest.seq\StressTest_Report[NO_UUT_SERIAL_NUM13][3 23 37 PM][4 28 2008] - TS2.html
    So everything looks correct, but it thinks that "T:\HTC" is the entire path.  So the next thing I did, after much confused pondering, was go to the "variables" tab while in break, and add an extra backslash to the part following "T:\HTC" in Locals.ReportFilePath so that the path is now:
    T:\HTC\\WING\3WWE\StressTest.seq\StressTest_Report[NO_UUT_SERIAL_NUM13][3 23 37 PM][4 28 2008] - TS2.html
    I hit retry and it worked.  So my question is, if teststand is thinking the "\W" is an escape code, why does it work 99%+ of the time, and suddenly this weird problem? 
    Thanks

    "A file with the pathname 'T:\HTC' already exists."
    This error indicates that there was a file called "T:\HTC" so the report saving code was not able to create a directory with that name. I doubt this has anything to do with backslash escaping anything since there is no expression evaluation involved and \W is not a valid backslash escapable character anyway.
    Why you had a file called HTC I do not know, but I looked and that is what this error is for. The Report saving code attempts to create all of the intermediate directories if they do not already exist and if one happens to exist, but is a file and not a directory you will get this error (it is the error we get from the operating system). It is possible there is a issue with the OS where it incorrectly reports this error in some cases (perhaps with multithreaded access), but that I do not know for certain.
    In searching for known OS issues I found the following:
    http://support.microsoft.com/kb/q268897/
    "On the other hand, an attempt to create a new C:\Development\Bin folder through the use of CreateDirectory() will fail with "ERROR_ALREADY_EXISTS". In this case, the API fails when it should succeed."
    Although it does sound like it was fixed in a service pack. Are you by any chance using NTFS on Windows 2000 and are not up to date with the lastest service pack?
    Also it's possibly an unknown OS bug, what OS version are you using and can you reproduce the problem in a simple case?
    Also, just to be sure you might want to make sure nothing is creating a file called 'T:\HTC' in your code.
    Hope this helps.
    -Doug
    Message Edited by dug9000 on 04-30-2008 10:58 AM

  • Metadata file write error?

    I have the trial version of photoshop and bridge cs5 on my windows 7 machine.  I was trying to add keywords to a jpg file and I keep getting an error that it can't do it.  The file is on my external iomega ego encrypt drive.  If I copy the file to my desktop it will write the metadata just fine.  I have the drive unlocked, but it still won't work.  Is there a preference I need to change for this to work as I don't want all 300 GB on my hard drive.  Thanks for any advice in advance!
    Namaste,
    Kristen

    External drives have permission problems created by the winddows OS.  Right click on the Bridge icon and choose "run as admininstor".  Even if you are a single user and set up as adminintrator, this seems to make a difference.
    Hope this helps.

  • File write error.

    I am trying to write a flat file out from a BPEL process. I get the following error when I invoke my partner link which is the Oracle File adaptor:
    <bindingFault>
    <part name="code" >
    <code>null</code>
    </part>
    <part name="summary" >
    <summary>file:/C:/OraBPELPM_1/integration/orabpel/domains/default/tmp/.bpel_ToCMSA1_1.0.jar/FlatFileOut.wsdl [ Write_ptt::Write(Root-Element) ] - WSIF JCA Execute of operation 'Write' failed due to: Translation Error. Error while translating message to native format. ; nested exception is: ORABPEL-11017 Translation Error. Error while translating message to native format. Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable. </summary>
    </part>
    <part name="detail" >
    <detail>null</detail>
    </part>
    </bindingFault>
    I don't understand why the file doesn't write. Any help would be greatly appreciated.
    Thank you.
    Mark

    Thank you for helping. My BPEL.xml file looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BPELSuitcase>
    <BPELProcess id="ToCMSA1" src="ToCMSA1.bpel">
    <partnerLinkBindings>
    <partnerLinkBinding name="PartnerLink_IN">
    <property name="wsdlLocation">FileIN.wsdl</property>
    </partnerLinkBinding>
    <partnerLinkBinding name="PartnerLink_Out">
    <property name="wsdlLocation">FlatFileOut.wsdl</property>
    <property name="retryInterval">60</property>
    </partnerLinkBinding>
    </partnerLinkBindings>
    <activationAgents>
    <activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="PartnerLink_IN">
    <property name="portType">Read_ptt</property>
    </activationAgent>
    </activationAgents>
    </BPELProcess>
    </BPELSuitcase>

  • File Write error in application server

    Hi All,
                 I am getting an error for writing data to a file in application server.
    Is there any way or transaction where in I can check Read or write access to a file?
    Please help.
    Thanks in advance
    Sanu

    Hi Raja,
                  Thanks for your reply.
    I have checked the program and file path in AUTHORITY_CHECK_DATASET FM.
    Everything is ok.
    But still I getting an error while uploading data to application server.
    My query is, are there any transactions wherein we can view or maintain read / write authorization to a file or directory.
    Can you please put some more of ur thought in to it?
    Thanks,
    sanu

  • File Write Error upon Export Movie

    Using iMovie 9.09 under OSX 10.8.5
    My sequence of events:
    1.  Import from Canon digital video camera
    2.  Create a project from the imported clips (no edits - it is an athletic event)
    3.  Share to iDVD
    4.  In iDVD create a disk image, then exit iDVD
    5.  Back in iMovie, Share>Export Movie  (readying to upload to YouTube)
         Size to Export:  HD 720p
         Filename is unique from any other used in this sequence
    After rendering, get the following error:
    So far, my only recourse is to quit iMovie, and restart the computer.
    Any ideas?
    Thanks,
    Greg

    Using iMovie 9.09 under OSX 10.8.5
    My sequence of events:
    1.  Import from Canon digital video camera
    2.  Create a project from the imported clips (no edits - it is an athletic event)
    3.  Share to iDVD
    4.  In iDVD create a disk image, then exit iDVD
    5.  Back in iMovie, Share>Export Movie  (readying to upload to YouTube)
         Size to Export:  HD 720p
         Filename is unique from any other used in this sequence
    After rendering, get the following error:
    So far, my only recourse is to quit iMovie, and restart the computer.
    Any ideas?
    Thanks,
    Greg

  • Problems with moving files to ora directory UTL_FILE.PUT_RAW - ORA-29285

    hi,
    i'm using apex 4.1
    i have a procedure which moves my file from apex_application_files to ORA directory.
    if i choose a text file or small word document which is 1kb, it works. but if i have pdf file (85kb) or word document (16kb) it gives me ORA-29285: file write error
    what's my problem?
    PROCEDURE put_file_to_server (p_filename IN VARCHAR2,p_cert_type IN VARCHAR2,p_cert_pk IN NUMBER)
    AS
    l_file UTL_FILE.file_type;
    l_blob_len INTEGER;
    l_pos INTEGER := 1;
    l_amount BINARY_INTEGER := 32767;
    l_buffer RAW (32767);
    v_new_filename VARCHAR2(100);
    v_bfile BFILE ;
    BEGIN
    -- delete from apex_application_files;
    --Neuen Dateinamen generieren
    v_new_filename := p_cert_type||'_'||p_cert_pk;
    v_bfile := BFILENAME (v_directory, v_new_filename);
    --Datei erstellen
    l_file := UTL_FILE.fopen(v_directory,v_new_filename,'w');
    IF DBMS_LOB.FILEEXISTS (v_bfile) = 1 THEN
    cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'File exists');
    FOR rec IN (select blob_content lblob from apex_application_files where rownum = 1)
    LOOP
    l_blob_len := DBMS_LOB.getlength(rec.lblob);
    cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Filesize is '||l_blob_len);
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.read (rec.lblob, l_amount, l_pos, l_buffer);
    UTL_FILE.put_raw (l_file, l_buffer, FALSE);
    l_pos := l_pos + l_amount;
    END LOOP;
    COMMIT;
    END LOOP;
    --Datei schließen
    UTL_FILE.fclose(l_file);
    else
    cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Datei doesn't exist');
    end if;
    EXCEPTION
    WHEN OTHERS
    THEN
    -- Close the file if something goes wrong.
    IF UTL_FILE.is_open (l_file) THEN
    UTL_FILE.fclose (l_file);
    END IF;
    delete from apex_application_files;
    RAISE;
    delete from apex_application_files;
    END put_file_to_server;

    Sorry but din't test this...Can you give it a try and see if this works?
    PROCEDURE put_file_to_server(
        p_filename  IN VARCHAR2,
        p_cert_type IN VARCHAR2,
        p_cert_pk   IN NUMBER)
    AS
      l_file UTL_FILE.file_type;
      l_blob_len INTEGER;
      l_pos      INTEGER      := 1;
      l_amount BINARY_INTEGER := 32767;
      l_buffer RAW (32767);
      v_new_filename VARCHAR2(100);
      v_bfile BFILE ;
      vblob BLOB;
      vstart NUMBER := 1;
      my_vr RAW(32000);
      bytelen NUMBER := 32000;
      LEN     NUMBER;
    BEGIN
      -- delete from apex_application_files;
      --Neuen Dateinamen generieren
      v_new_filename := p_cert_type||'_'||p_cert_pk;
      v_bfile        := BFILENAME (v_directory, v_new_filename);
      --Datei erstellen
      --l_file                          := UTL_FILE.fopen(v_directory,v_new_filename,'w');
      l_file                          := UTL_FILE.fopen(v_directory,v_new_filename, 'WB', 32760);
      IF DBMS_LOB.FILEEXISTS (v_bfile) = 1 THEN
        cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'File exists');
        FOR rec IN
        (SELECT blob_content lblob,
          LENGTH(blob_content) LEN
        FROM apex_application_files
        WHERE rownum = 1
        LOOP
          cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Filesize is '|| LEN);
          IF LEN < 32760 THEN
            utl_file.put_raw(l_file,lblob);
            utl_file.fflush(l_file);
          ELSE -- write in pieces
            vstart      := 1;
            WHILE vstart < LEN
            LOOP
              dbms_lob.read(vblob,bytelen,vstart,my_vr);
              utl_file.put_raw(l_file,my_vr);
              utl_file.fflush(l_file);
              -- set the start position for the next cut
              vstart := vstart + bytelen;
              -- set the end position if less than 32000 bytes
              x         := x - bytelen;
              IF x       < 32000 THEN
                bytelen := x;
              END IF;
            END LOOP;
          END IF;
         END LOOP;
        ELSE
          cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Datei doesnt exist');
        END IF;
        utl_file.fclose(l_file);
      EXCEPTION
      WHEN OTHERS THEN
        -- Close the file if something goes wrong.
        IF UTL_FILE.is_open (l_file) THEN
          UTL_FILE.fclose (l_file);
        END IF;
        DELETE FROM apex_application_files;
        RAISE;
        DELETE FROM apex_application_files;
      END put_file_to_server;Edited by: Vitor Rodrigues on 17/Fev/2012 12:03

  • Problem Using UTL_FILE package ORA-29285

    Dear All,
    I would very much appreciate your help.
    I am trying to export data form a table.
    The version of the DB is 10.2.0.4
    I am using the following procedure:
    create or replace
    procedure EXPORT_FRAME(
    dir IN VARCHAR2, filename IN VARCHAR2) IS
    f utl_file.file_type;
      cursor frame is
        Select *
        from test_complete_frame_2008;
    begin
      f:= utl_file.fopen (dir, filename,'w');
      FOR a IN frame
      Loop
        utl_file.put_line (f,
            '"'||a.COM_DATA_ID || '";"' ||
               a.COM_DATA_SET_ID || '";"'||
                a.NSI || '";"'||
                a.FRAME_ID || '";"'||
                a.STATUS_FRAME || '";"'||
                TO_CHAR(a.FRAME_REFERENCE_DATE, 'dd/mm/yyyy') || '";"'||
                TO_CHAR(a.DATE_OF_SELECTION, 'dd/mm/yyyy')  || '";'||
                a.EU_LEU_ID || ';"'||
                a.NSA_ID || '";"'||
                a.SOURCE_IDENTITY || '";"'||
                TO_CHAR(a.REF_DATE_LEU_IDENTITY, 'dd/mm/yyyy') || '";"'||
                a.NATIONAL_ID || '";"'||
                a.REF_DATE_NATIONAL_ID || '";"'||
                a.DUNS_NUMBER || '";"'||
                TO_CHAR(a.REF_DATE_DUNS_NUMBER, 'dd/mm/yyyy') || '";"'||
                a.BVD_ID || '";"'||
                TO_CHAR(a.REF_DATE_BVD_ID, 'dd/mm/yyyy') || '";"'||
                a.NAME_LEGAL_UNIT || '";"'||
                a.LEGAL_FORM_EGR || '";"'||
                a.SOURCE_LEGAL_FORM || '";"'||
                TO_CHAR(a.REF_DATE_LEGAL_FORM, 'dd/mm/yyyy') || '";"'||
                a.TYPE_OF_LEGAL_UNIT || '";"'||
                a.SOURCE_CODE_TYPE_OF_LEU || '";"'||
                TO_CHAR(a.REF_DATE_TYPE_OF_LEU, 'dd/mm/yyyy') || '";"'||
                a.STATUS_LEU || '";"'||
                a.SOURCE_CODE_STATUS_LEU || '";"'||
                TO_CHAR(a.REF_DATE_STATUS_LEU, 'dd/mm/yyyy') || '";"'||
                a.POST_DELIVERY_POINT || '";"'||
                a.CITY_NAME || '";"'||
                a.POSTAL_CODE || '";"'||
                a.STATE_NAME || '";"'||
                a.COUNTRY_CODE_BOP || '";"'||
                a.COUNTRY_ACCESS_CODE || '";"'||
                a.TELEPHONE_NUMBER || '";"'||
                a.FAX_NUMBER || '";"'||
                TO_CHAR(a.DATE_OF_INCORPORATE, 'dd/mm/yyyy') || '";"'||
                a.SOURCE_DATE_OF_INCORP || '";"'||
                TO_CHAR(a.REF_DATE_DATE_OF_INCORP, 'dd/mm/yyyy') || '";"'||
                TO_CHAR(a.DATE_OF_LIQUIDATION, 'dd/mm/yyyy') || '";"'||
                a.SOURCE_DATE_OF_LIQ || '";"'||
                TO_CHAR(a.REF_DATE_DATE_OF_LIQ, 'dd/mm/yyyy') || '";"'||
                a.NACE_CODE || '";"'||
                a.VERSION_NACE || '";"'||
                a.SOURCE_CODE_NACE || '";"'||
                TO_CHAR(a.REF_DATE_NACE, 'dd/mm/yyyy') || '";"'||
                a.NUMBER_PERS_EMPLOYED || '";"'||
                a.SOURCE_CODE_PERS_EMPL || '";"'||
                a.CONS_PERSON_EMPLOYED || '";"'||
                TO_CHAR(a.REF_DATE_PERS_EMPLOYED, 'dd/mm/yyyy') || '";"'||
                a.SPECIAL_PURP_ENTITY_CODE || '";"'||
                a.SOURCE_CODE_SPE || '";"'||
                TO_CHAR(a.REF_DATE_SPE_CODE, 'dd/mm/yyyy') || '";"'||
                a.EMAIL_ADDRESS || '";"'||
                TO_CHAR(a.REF_DATE_EMAIL_ADDRESS, 'dd/mm/yyyy') || '";"'||
                a.WEB_ADDRESS || '";"'||
                TO_CHAR(a.REF_DATE_WEB_ADDRESS, 'dd/mm/yyyy') || '";"'||
                a.P_EU_LEU_ID || '";"'||
                a.P_NAME_LEGAL_UNIT || '";"'||
                a.P_COUNTRY_CODE_BOP || '";"'||
                a.STATUS_RELATIONSHIP || '";"'||
                a.PERCENTAGE || '";"'||
                a.KIND_OF_CONTROL || '";"'||
                a.SOURCE_CODE_RELATIONSHIP || '";"'||
                TO_CHAR(a.REF_DATE_RELATIONSHIP, 'dd/mm/yyyy') || '";"'||
                a.GLOBAL_LEVEL || '";"'||
                a.GGH_EU_LEU_ID || '";"'||
                a.GGH_NAME_LEGAL_UNIT || '";"'||
                a.GGH_COUNTRY_CODE_BOP || '";"'||
                a.GGH_NSA_ID || '";"'||
                a.GGH_DUNS_NUMBER || '";"'||
                a.GGH_BVD_ID || '";"'||
                a.GGH_SOURCE_IDENTITY || '";"'||
                a.GLOBAL_EG_ID || '";"'||
                a.GLOBAL_EG_NAME || '";"'||
                a.TOP_MNE_IND || '";"'||
                a.GEG_PERSONS_EMPLOYED || '";"'||
                a.GEG_SOURCE_CODE_PERS_EMPL || '";"'||
                TO_CHAR(a.GEG_REF_DATE_PERS_EMPL, 'dd/mm/yyyy') || '";"'||
                a.NUMBER_OF_LEGAL_UNITS || '";"'||
                a.GEG_NACE_CODE_DIV || '";"'||
                a.GEG_SOURCE_CODE_NACE || '";"'||
                TO_CHAR(a.GEG_REF_DATE_NACE, 'dd/mm/yyyy') || '";"'||
                a.GEG_CONS_TURNOVER || '";"'||
                a.GEG_VALUTA_CONS_TURNOVER || '";"'||
                TO_CHAR(a.GEG_BEGIN_CONS_TURNOVER, 'dd/mm/yyyy') || '";"'||
                TO_CHAR(a.GEG_END_CONS_TURNOVER, 'dd/mm/yyyy') || '";"'||
                a.GEG_SOURCE_CONS_TURNOVER || '";"'||
                TO_CHAR(a.GEG_REF_DATE_C_TURNOVER, 'dd/mm/yyyy') || '";"'||
                a.GEG_TOTAL_ASSETS || '";"'||
                a.GEG_VALUTA_TOTAL_ASSETS || '";"'||
                a.GEG_SOURCE_TOTAL_ASSETS || '";"'||
                TO_CHAR(a.GEG_REF_DATE_TOTAL_ASSETS, 'dd/mm/yyyy') || '";"'||
                a.GEG_WEB_ADDRESS || '";"'||
                a.GDC_EU_LEU_ID || '";"'||
                a.GDC_NAME_LEGAL_UNIT || '";"'||
                a.GDC_COUNTRY_CODE_BOP || '";"'||
                a.GDC_NSA_ID || '";"'||
                a.GDC_DUNS_NUMBER || '";"'||
                a.GDC_BVD_ID || '";"'||
                a.GDC_SOURCE_IDENTITY || '";"'||
                a.REP_EU_LEU_ID || '";"'||
                a.REP_NAME_LEGAL_UNIT || '";"'||
                a.REP_POST_DELIVERY_POINT || '";"'||
                a.REP_POSTAL_CODE || '";"'||
                a.REP_STATE_NAME || '";"'||
                a.REP_CITY_NAME || '";"'||
                a.REP_COUNTRY_CODE_BOP || '"'
           UTL_FILE.new_line (f);
      END LOOP;
      UTL_FILE.new_line (f);
      UTL_FILE.fclose(f);
        EXCEPTION
          WHEN NO_DATA_FOUND
            THEN dbms_output.put_line ('FAILED');
    END EXPORT_FRAME;I get an error message:
    Error starting at line 1 in command:
    begin EXPORT_FRAME ('EXP','test2.csv'); end;
    Error report:
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 136
    ORA-06512: at "SYS.UTL_FILE", line 813
    ORA-06512: at "EGR.EXPORT_FRAME", line 13
    ORA-06512: at line 1
    29285. 00000 - "file write error"
    *Cause:    Failed to write to, flush, or close a file.
    *Action:   Verify that the file exists, that it is accessible, and that
    it is open in write or append mode.
    Any idea?
    Thanks in advance!

    By default UTL_FILE.FOPEN opens file with record size up to 1024 characters (including newline). Most likely your code exceeds 1024. Change:
    f:= utl_file.fopen (dir, filename,'w');to something like (assuming none of your records will exceed 10000)
    f:= utl_file.fopen (dir, filename,'w',10000);SY.

  • Reg: File Write err-

    Hi Experts,
    I've a procedure where I'm using
    DBMS_XSLPROCESSOR.clob2file(v_xml_charset,'TEST_DIR',v_filename);to place a XML generated into a Server directory (in an UNIX box).
    On executing the proc, a blank file (size=0) is getting generated in the UNIX directory. But it also throws an error to the client where I'm executing the proc.
    Error at line 1
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 183
    ORA-06512: at "SYS.UTL_FILE", line 1169
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 333
    ORA-06512: at "SCHEMA_X.PROC_X", line 136
    ORA-06512: at line 4Also I checked the Grants, Do i need to give READ/WRITE grants to this directory??
    Found a similar thread: Error with dbms_xslprocessor.clob2file
    Any help is much appreciated.
    Thanks,
    Ranit

    ranit B wrote:
    I didn't understand you clearly but this sounds like something helpful. Can you put some more light on this?
    Why because -
    "This is in directory TEST_DIR"
    -rw-r--r--   1 oracle   emk            0 May  8 01:54 file_x.xml
    "This is in directory TEST_X"
    -rw-r--r--   1 oracle   oinstall  116274 May  8 02:09 file_x.xmlWhat does the 4th column indicate? Some special user?The 4th column is the unix group name rather than the 3rd column which is the owner name.
    Did you manually create that file_x.xml in the TEST_DIR directory, or has that been created by Oracle? If so, then Oracle has been able to write to the directory, so the issue may be around space on the disk?
    Just to check do...
    df -k .in the TEST_DIR directory and see what it reports.

  • Irig106 file write

    Hi everyone, 
                          Iam trying to write the analog data in IRIG106 (.ch10) file format, In Labview we are having the storage/dataplugin on the pallet by using which we can read the files by using the respective dataplugins.
    We can see the data using the Datafileviewer.vi  available on the  vi pallet.
    Can anyone suggest me how to write the file in IRIG106 (.ch10) file format using LabVIEW. 
    Thanks in Advance
    Thanks & Regards
    Ikram
    A.E

    ORA-29285 file write error
    Cause: Failed to write to, flush, or close a file.
    Action: Verify that the file exists, that it is accessible, and that it is open in write or append mode

  • UTL_FILE - file read error

    Hi,
    I am using UTL_FILE to read one file and write it into other file.
    When i am executing procedure that uses UTL_FILE, i get error "ORA-29284: file read error".
    I have checked that file exists with all permissions (r,w,e). Is there any limitaion of size to be read by utl_file. my file size is 62 kb.
    I have set max_linesize to 32767/
    Can anybody tell me the reason why it is happening?

    can you post the script being used...
    What's the database version
    A database object called Directory is also needed in database that is created using the create directory command which directs to the folder in the file system. Is that already created?
    Regards

Maybe you are looking for

  • Is there a way to connect an external speaker (for another room) through the headphone port

    Is there a way to connect an external speaker (for another room) through the headphone port  & still hear sound through the internal speakers?  System Preferences/Sound/Output or Sound Effects allows you to use one or the other  --  headphones or int

  • Logical dimension table

    Hi All, I am creating logical columns using two logical dimensions in a separate logical table. Do I need create complex joins for the new logical table, two source logical dimension tables have complex joins created already. Could you anyone provide

  • Broadband Speed dropped from 2.7Mbps to 448KBps To...

    Last night my Connection was at 2.7Mbps, got home from work today at 17:00 and i had no connection, after numerous resets and even a factory reset of my 2wire hub, i got Broadband back, but at 448KBps!! Any Help? Just done the BT Speedtest and it say

  • Incompatibility with Photoshop CS2 ??

    I was running Photoshop CS2 two weeks ago, then last week it would crash every time. Has something in the OS  changed that would cause this?  I have repaired disk permissions and trashed the Prefs file.  Is there anything else I can do to prevent the

  • [svn] 3766: Fix for BLZ-261: Null pointer exception in Websphere login code .

    Revision: 3766 Author: [email protected] Date: 2008-10-21 05:59:49 -0700 (Tue, 21 Oct 2008) Log Message: Fix for BLZ-261: Null pointer exception in Websphere login code. Protect the debug logging from being called if the principal variable is null. T