How to Read DBFS Contents Using PLSQL

(Doc ID 1378785.1)

Last updated on AUGUST 29, 2017

Applies to:

Oracle Database - Enterprise Edition - Version and later
Information in this document applies to any platform.
Oracle RDBMS, Exadata that has Database Filesystem.


Executing a PLSQL procedure or anonymous block to read the contents of a file from a DBFS mount fails with the following error:

  buf raw(32767);
  props dbms_dbfs_content.properties_t;
  data blob;
  itype integer;
  len number;
  off number;
  amt number;
  dbms_dbfs_content.getpath(path=>'/dbfs_direct/FS1/test', properties=> props, content=>data,  
    item_type=> itype, prop_flags=>dbms_dbfs_content.prop_data);
  len := dbms_lob.getlength(data);
  dbms_output.put_line('Length: ' || len);
  off := 1;
  while off < len loop
      amt := 32767;, amt, off, buf);
      if amt > 0 then
      end if;
      off := off + amt;
  end loop;

ERROR at line 1:
ORA-64002: specified path is invalid
ORA-06512: at "SYS.DBMS_DBFS_CONTENT", line 455
ORA-01403: no data found
ORA-06512: at "SYS.DBMS_DBFS_CONTENT", line 3103
ORA-06512: at "SYS.DBMS_DBFS_CONTENT", line 3162
ORA-06512: at line 10


Utilization of DBFS mounts for storing files.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms