0

Everyone,

We have a set of 8 jobs which runs in parallel on Unix server. Those jobs calls Oracle stored procedure. All those procedures does a set of DB operations (on different tables) and at the end creates files in Unix server. (Each job creates a file in different names. But puts in same folder)

Recently, we are seeing random failures with error message "ORA-06512: at "SYS.UTL_FILE", line 536". Each day one or two job fails, while creating the error report. When the job is rerun there is no issues. We couldn't reproduce the issue in lower environment.

The folder has all access granted. This jobs have been running for more than an year with no issues. Any ideas appreciated.

Based on my analysis:- DB Operations have completed without any issues. There is no file created (not even an empty one). So it failed while encountering fopen.

Sample code

DECLARE
 IN_CONT_TYPE   varchar2(100) := 'HARDWARE_ATTRIBUTES' ;
    in_batch_name  ccpm_epslz_control.push_batch_name%TYPE := 'HARDWARE_ATTRIBUTES_20181211062540';
  l_file_type utl_file.file_type;
  file_record_hold_cur sys_refcursor;
BEGIN

/*DB Operations*/

      l_file_type       :=utl_file.fopen('ERR_FOLDER',l_file_name,'W');
      utl_file.put_line(l_file_type, 'count of input records filtered based on errors:');
      utl_file.put_line(l_file_type, '-----------------------------------------------');
      utl_file.put_line(l_file_type, l_col_name_print);
      OPEN file_record_hold_cur FOR l_select_stmt_bus;
      LOOP
        FETCH file_record_hold_cur INTO l_putline_stmt_bus;
        EXIT
      WHEN file_record_hold_cur%notfound;
        utl_file.put_line(l_file_type, l_putline_stmt_bus);
      END LOOP;
      CLOSE file_record_hold_cur;
      utl_file.fclose(l_file_type);
    EXCEPTION
    WHEN OTHERS THEN
      Dbms_Output.put_line ( DBMS_UTILITY.FORMAT_ERROR_BACKTRACE() );
    END;

ERROR MESSAGE:- ORA-20051: Internal Error in file generationORA-06512: at "MYPACKAGE", line 84                                                                    ORA-06512: at "SYS.UTL_FILE", line 536

Valli
  • 1,440
  • 1
  • 8
  • 13
  • You've only shown a single error message; can you include the whole stack of errors? – Alex Poole Dec 12 '18 at 19:05
  • Thanks @AlexPoole ! I have added the whole stack of errors – Valli Dec 12 '18 at 19:09
  • `ORA-20051` is a **user-defined** exception. It may be declared in `mypackage`, certainly it's raised there. So it seems this is not something we can help with, except to advise you to fire up a text editor, open the source code for `mypackage` and look hard at the code leading up to line 64. – APC Dec 12 '18 at 19:17
  • Yes, ORA-20051 is an user defined exception. And it raises when it is unable to create the file. Any idea why am getting ORA-06512 at sys.utl_file? – Valli Dec 12 '18 at 19:22
  • Full disk, perhaps? – TenG Dec 12 '18 at 20:05
  • I checked, there is space. – Valli Dec 12 '18 at 20:17
  • @Georgy Can you please explain how that will help me? – Valli Dec 12 '18 at 21:41

0 Answers0