SecureFiles was first introduced in Oracle Database 11g, and enables a major paradigm shift for storing and managing files. SecureFiles provides the best solution for storing file content such as images, audio, video, PDFs, spreadsheets etc. Traditionally, relational data is stored in a database while unstructured data is stored as files in file systems. SecureFiles is specifically engineered to deliver high performance for file data comparable to that of traditional file systems while retaining the advantages of Oracle Database. SecureFiles offers the best-of-both-worlds architecture from both the database and filesystem worlds for storing unstructured data. With SecureFiles, Oracle has perfected the use of the database for storage of all enterprise data.
Key Technical Advantages
SecureFiles is designed for high performance and includes advanced features typically found in high-end file systems.
This section discusses how to mount DBFS file systems. It applies to Linux and Solaris 11 SRU7.5.
This section contains the following topics:
- Mounting a DBFS File System - Unmounting a DBFS File System in Linux - Mounting DBFS with fstab Utility in Linux - Oracle Database Release 220.127.116.11 with Solaris 11 SRU7.5 - Restrictions on Mounted File Systems
Mounting a DBFS File System
Run the dbfs_client program to mount a DBFS file system. Ensure that LD_LIBRARY_PATH has the correct path to the Oracle client libraries before calling this program. The dbfs_client program does not return until the file system is unmounted.
- db_user is the name of the database user who owns the DBFS content store filesystem(s). - db_server is a valid connect string to the Oracle Database server, such as hrdb_host:1521/hrservice. - mount_point is the path where the Database File System is mounted. Note that all file systems owned by the database user are seen at the mount point.
and the options are: - direct_io bypasses the Linux page cache, and provides improved throughput for large files. Programs in the file system cannot be executed with this option. Oracle recommends this option when DBFS is used as an ETL staging area. - wallet runs the DBFS client in the background. Wallet must be configured to get its credentials. - failover fails over the DBFS client to the surviving database instance with no data loss. Expect some performance cost on writes, especially for small files. - allow_root allows the root user to access the filesystem. This option requires setting the user_allow_other parameter in the /etc/fuse.conf configuration file. - allow_other allows other users to access the filesystem. This option requires setting the user_allow_other parameter in the /etc/fuse.conf configuration file. - rw mounts the filesystem as read-write; this is the default setting. - ro mounts the filesystem as read-only; files cannot be modified. - trace_level=n sets the trace level. Trace levels are: 1. DEBUG 2. INFO 3. WARNING 4. ERROR 5. CRITICAL; this the default setting - trace_file file_name |'syslog' specifies the trace log file Prior to mounting a DBFS file system, you must create an Oracle Wallet and assign credentials for the appropriate DBFS database user.
Unmounting a File System in Linux Run fusermount to unmount file systems. $ fusermount -u [mount point]
Mounting DBFS with fstab Utility in Linux
File systems are commonly configured using the fstab utility in Linux. To mount DBFS through /etc/fstab, You must use Oracle Wallet for authentication. Run the following operations as root user.
To mount DBFS through fstab in Linux: 1. Login as root user.
2. Change the user and group of dbfs_client to be user root and group fuse. # chown root.fuse $ORACLE_HOME/bin/dbfs_client
3. Set the setuid bit on dbfs_client, and restrict execute privileges to the user and group only. # chmod u+rwxs,g+rx-w,o-rwx dbfs_client
4. Create a symbolic link to dbfs_client in /sbin as mount.dbfs. $ ln -s $ORACLE_HOME/bin/dbfs_client /sbin/mount.dbfs
5. Create a new Linux group called fuse.
6. Add the Linux user that is running the DBFS Client to the fuse group.
8. The Linux user can mount the DBFS file system using the standard Linux mount command. For example:
$ mount /mnt/dbfs
Note that FUSE does not currently support automount.
Oracle Database Release 18.104.22.168 with Solaris 11 SRU7.5
Beginning with Oracle Database Release 22.214.171.124 , with Solaris 11 SRU7.5, you can install libfuse and run dbfs_client in mount mode on Solaris.
Installing FUSE on Solaris 11 SRU7.5 and Later
To use dbfs_client as a mount client in Solaris 11 SRU7.5 and later, ensure that the libfuse package is installed by running pkg info libfuse at the prompt. If no rows or errors are returned, then perform these steps to install libfuse.
Run the install command as root.
# pkg install libfuse
Run the verify command to confirm that libfuse is installed successfully. There will be no output if successful.
# pkg verify libfuse
To unmount a DBFS filesystem on Solaris, use the standard umount system command.
Mounting the DBFS Store: Solaris-Specific Privileges
On Solaris, the user must have the Solaris privilege PRIV_SYS_MOUNT to perform mount and unmount operations on DBFS filesystems. Edit /etc/user_attr and add or modify the user entry (assuming the user is Oracle) as follows:
Mounting DBFS Through the vfstab Utility for Solaris
On Solaris, file systems are commonly configured using the vfstab utility. To mount DBFS through vfstab:
1. Create a mount shell script mount_dbfs.sh to use to start dbfs_client. All the environment variables that are required for Oracle Database must be exported. These environment variables include TNS_ADMIN, ORACLE_HOME, and LD_LIBRARY_PATH. For example:
2. Add an entry for DBFS to /etc/vfstab. Specify the mount_dbfs.sh script for the device_to_mount. Specify uvfs for the FS_type. Specify no formount_at_boot. Specify mount options as needed. For example:
/usr/local/bin/mount_dbfs.sh - /mnt/dbfs uvfs - no rw,allow_other
3. User can mount the DBFS file system using the standard Solaris mount command. For example:
$ mount /mnt/dbfs
4. User can unmount the DBFS file system using the standard Solaris umount command. For example:
$ umount /mnt/dbfs
Restrictions on Mounted File Systems DBFS supports most file system operations with the exception of ioctl, locking, asynchronous I/O through libaio, O_DIRECT file opens, hard links, pipes, and other special file modes. Memory-mapped files are supported except in shared-writable mode. For performance reasons, DBFS does not update the file access time every time file data or its attributes are read. You cannot run programs from a DBFS-mounted file system if the direct_io option is specified. Note: allow_root is not supported on Solaris mounts.
In addition to these advanced file system features, SecureFiles can take advantage of several advanced Oracle Database capabilities such as:
Transactions, Read Consistency, Flashback
100% Backward Compatibility with LOB Interfaces
Readable Standby, Consistent Backup, Point in Time Recovery
Fine Grained Auditing, Label Security
XML indexing, XML Queries, XPath
Real Application Clusters
Automatic Storage Management
Partitioning and ILM
Data stored in SecureFiles can be accessed through both database and file system clients. SecureFiles interfaces are completely backward with LOB interfaces. More information on using SecureFiles and Migration can be found here.