8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » 12c » Here

Oracle Database File System (DBFS) Enhancements in Oracle Database 12c Release 1 (12.1)

The Oracle Database File System (DBFS) functionality was introduced in Oracle 11g. The major downside to this feature was real file system style access was only available on the Linux platform due to the reliance on the FUSE project. All other platforms were limited to using the client tool to access the file system.

Oracle 12c introduces HTTP/HTTPS, FTP and WebDAV access to DBFS via the "/dbfs" virtual directory in the XML DB repository.

Related articles.

Setup

The setup of a DBFS file system in 12c is the same as that for Oracle 11g, explained here. The following code creates a new tablespace, user and DBFS file system.

CONN / AS SYSDBA

CREATE TABLESPACE dbfs_ts
  DATAFILE '/u01/app/oracle/oradata/DB12C/dbfs01.dbf'
  SIZE 1M AUTOEXTEND ON NEXT 1M;

CREATE USER dbfs_user IDENTIFIED BY dbfs_user
  DEFAULT TABLESPACE dbfs_ts QUOTA UNLIMITED ON dbfs_ts;

GRANT CREATE SESSION, RESOURCE, CREATE VIEW, DBFS_ROLE TO dbfs_user;
EXIT;

cd $ORACLE_HOME/rdbms/admin
sqlplus dbfs_user/dbfs_user

SQL> @dbfs_create_filesystem.sql dbfs_ts staging_area

HTTP and HTTPS Access

Oracle 12c automatically enables read-only access to the DBFS file systems via the "/dbfs" virtual directory in the XML DB repository.

Check the HTTPS port is configured on your server.

SQL> SELECT DBMS_XDB_CONFIG.gethttpsport FROM dual;

GETHTTPSPORT
------------
        5500
SQL>

If it is set to "0", set the desired port using the following command.

SQL> EXEC DBMS_XDB_CONFIG.sethttpsport(5500);

The DBFS file system should now be visible using the following style of URL.

https://machine:port/dbfs
https://username:password@machine:port/dbfs

https://ol6-121.localdomain:5500/dbfs
https://DBFS_USER:dbfs_user@ol6-121.localdomain:5500/dbfs

By default, both HTTP and HTTPS use basic authentication, so if you do not specify the credentials in the URL you will need to enter them when prompted. Both the username and password are case sensitive, so specify the username in uppercase.

The browser displays the file system in the usual manner.

DBFS over HTTPS

If you need HTTP access, check the HTTP port number and set it if it is currently set to "0".

SQL> SELECT DBMS_XDB_CONFIG.gethttpport FROM dual;

GETHTTPPORT
-----------
          0
SQL> EXEC DBMS_XDB_CONFIG.sethttpport(8080);

FTP Access

Oracle 12c automatically enables FTP access to the DBFS file systems via the "/dbfs" virtual directory in the XML DB repository.

Check the FTP port is configured on your server. If it is set to "0", set it to the desired port.

SQL> SELECT DBMS_XDB_CONFIG.getftpport FROM dual;

GETFTPPORT
----------
         0
SQL> EXEC DBMS_XDB_CONFIG.setftpport(4021);

The DBFS file system will now be available using any FTP client using the host:port combination you have specified, along with the credentials of the owner of the file system.

DBFS over FTP

WebDAV Access

The HTTP/HTTPS address specified previously can also be used to enable WebDAV access to the DBFS file system.

It seems WebDAV doesn't really work in some old builds of Windows 7. To test this functionality I fired up a Windows XP virtual machine.

Start the "Add Network Place Wizard" (Start > Control Panel > Network Connections > My Network Places > Add a new network place). Click the "Next" button.

DBFS WebDAV Network Places

Click the "Next" button.

DBFS WebDAV Network Places

Enter the HTTP/HTTPS URL as the WebDAV address, then click the "Next" button.

DBFS WebDAV Network Places

If you are using HTTPS and you are using the demo certificate, you will have to click the "Yes" button on two warning dialogs.

DBFS WebDAV Network Places

Enter the WebDAV credentials and click the "OK" button.

DBFS WebDAV Network Places

Alter the name of the network place if you wish, then click the "Next" button.

DBFS WebDAV Network Places

Click the "Finish" button.

DBFS WebDAV Network Places

The network place is now available from Windows explorer. You can use it like any other file system on your machine. Notice the file system we created called "staging_area".

DBFS WebDAV Network Places

Digest Authentication

HTTP access to the database can now be configured to use Digest Authentication, as described here.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.