My Oracle Support Banner

How to Read DBFS Contents Using PLSQL (Doc ID 1378785.1)

Last updated on DECEMBER 16, 2019

Applies to:

Oracle Database - Enterprise Edition - Version and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Oracle Database Cloud Schema Service - Version N/A 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.


To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.