Let’s Explore How to Attach a File System to Oracle Autonomous Database

Introduction

Oracle Cloud Infrastructure (OCI) File Storage is a fully managed, elastic file system that supports the Network File System (NFS) protocol. It provides shared, scalable file storage that can be mounted concurrently by multiple compute instances and database systems within a Virtual Cloud Network (VCN). Oracle Autonomous Database, consisting of Autonomous Data Warehouse (ADW) and Autonomous Transaction Processing (ATP), is Oracle’s fully-managed database platform that automates provisioning, tuning, scaling, patching, and backups. While Autonomous Database does not provide direct OS-level file system access, certain deployment configurations — such as Oracle Autonomous Database on Dedicated Exadata Infrastructure, or Autonomous Database with private endpoint — allow integration with File Storage over a private VCN. Attaching File Storage to an Autonomous Database enables:

Objectives

This document outlines the process and considerations for integrating OCI File Storage Service with Oracle Autonomous Data Warehouse (ADW) or Autonomous Transaction Processing (ATP) using a private endpoint. The objectives are to:

Prerequisites

Before attaching an OCI File Storage to an Autonomous Database (ADW/ATP), ensure the following requirements are met:

Service & Deployment Requirements

An Autonomous Database deployed with either:

File Storage must be provisioned in the same region as the Autonomous Database.

Networking Requirements

VCN & Subnet Configuration:
The Autonomous Database and the File Storage mount target must be in the same VCN/subnet, or connected via VCN peering.

Security Rules/NSGs:
Allow inbound and outbound NFS traffic between the Autonomous Database and File Storage mount target:

DNS Resolution:
Ensure private DNS is enabled so the File Storage mount target’s FQDN can be resolved from the Autonomous Database.

IAM Permissions

You must have the following OCI permissions:

You must have the following Database-level privilege:

Tools & Access

You must have access to the following tools:

Information to Collect Before Starting

Tasks

In the following tasks, you will configure and validate integration between File Storage and an Autonomous Database (ADW/ATP) deployed with private endpoint access.

Here are the steps:

  1. Provision OCI ADW with private endpoint access only
  2. Create VCN security rules for File Storage access
  3. Create a file system in File Storage
  4. Obtain the fully-qualified domain name (FQDN) for the mount target
  5. Attach the file system to Autonomous Database
  6. Query DBA_CLOUD_FILE_SYSTEMS
  7. Create and write to a file via UTL_FILE
  8. List files in the attached file system and read a file via UTL_FILE

Task 1: Provision Autonomous Database

Create an ADW instance with private endpoint in the appropriate VCN and subnet.

Image showing how to create an ADW instance with private endpoint

Task 2: Configure Network Security

Create or update VCN security lists or network security groups to allow NFS protocol traffic between the Autonomous Database subnet and File Storage mount target subnets.

Create VCN security rules for File Storage access, by adding some ingress and egress rules in the VCN’s security list so that your Autonomous Database and file system can talk to each other.

Stateful ingress from ALL ports in source CIDR block to TCP ports 111, 2048, 2049, and 2050.
Stateful ingress from ALL ports in source CIDR block to UDP ports 111 and 2048.
Stateful egress from TCP ALL ports to ports 111, 2048, 2049, and 2050 in destination CIDR block.
Stateful egress from UDP ALL ports to port 111 in destination CIDR block.
Make sure service gateways is available

Image showing VCN details
Image showing ingress rules
Image showing egress rules

Task 3: Provision OCI File Storage

Create a file system in File Storage.
Home -> Storage -> File Storage -> File Systems -> Create File System for NFS in OCI console.
Make sure the mount target is the same as the Autonomous Database’s VCN and subnet.

Create a file system and a mount target in the same VCN or a peered VCN. Image showing how to create a file system and a mount target in the same VCN or a peered VCN

Home -> Storage -> File Storage -> Mount Targets in OCI console.

Configure export settings for the mount target.
Image showing exports

Task 4: Obtain Mount Target Details

Retrieve the fully qualified domain name (FQDN) and export path of the mount target.

File Storage -> Mount Targets -> <yourMountTargetName> in OCI console and obtain FQDN as shown below:

Image showing how to retrieve the fully qualified domain name (FQDN) and export path of the mount target

Task 5: Attach the File System to Autonomous Database

  CREATE DIRECTORY FSS_DIR AS 'fss';

  BEGIN
    DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM(
      file_system_name => 'FileSystemTest',
      file_system_location => 'test.sub04171438361.oracledatabase2.oraclevcn.com:/  FileSystem-20250801-1113-05',
     directory_name => 'FSS_DIR',
      description => 'attach OCI file system'
    );
  END;
  /

Use DBMS_CLOUD_ADMIN.CREATE_FILE_SYSTEM to mount the File Storage to the Autonomous Database. Image showing how to attach the file system to Autonomous Database

Task 6: Verify File System Attachment

Query DBA_CLOUD_FILE_SYSTEMS to confirm that the file system is mounted successfully.

SELECT file_system_name, file_system_location, directory_path FROM dba_cloud_file_systems;

Image showing how to verify file system attachment

Task 7: Perform File Operations

Create a directory object pointing to the File Storage & write files using UTL_FILE.PUT_LINE.

(You can create a file called channel.csv and write into it:)

DECLARE
  l_file         UTL_FILE.file_type;
  l_location     VARCHAR2(100) := 'FSS_DIR';
  l_filename     VARCHAR2(100) := 'channel.csv';
BEGIN
  -- Open file.
  l_file := UTL_FILE.fopen(l_location, l_filename, 'w');
   
  UTL_FILE.PUT(l_file, 'Catalog, Indirect, 12');
 
  -- Close the file.
  UTL_FILE.fclose(l_file);
END;
/

List files using DBMS_CLOUD.LIST_FILES.

SELECT object_name FROM DBMS_CLOUD.LIST_FILES('FSS_DIR');

Read file contents using UTL_FILE.GET_LINE.

DECLARE
  l_file         UTL_FILE.file_type;
  l_location     VARCHAR2(100) := 'FSS_DIR';
  l_filename     VARCHAR2(100) := 'channel.csv';
  l_text         VARCHAR2(32767);
BEGIN
  -- Open file.
  l_file := UTL_FILE.fopen(l_location, l_filename, 'r');
 
 UTL_FILE.GET_LINE(l_file, l_text, 32767);
 DBMS_OUTPUT.put_line(l_text);

  -- Close the file.
  UTL_FILE.fclose(l_file);
END;
/

Task 8: Document Restrictions and Limitations

Capture the supported configurations, service constraints, and known limitations for using OCI File Storage with Oracle Autonomous Database.

Key Validations

This works only if:

ADW has a private endpoint in the same VCN/subnet as File Storage or connected via VCN peering.

Security lists/NSGs allow NFS ports.

You’re using Oracle Autonomous Database on Dedicated Infrastructure, or Oracle Autonomous Database shared with private endpoint + OCI File Storage support.

DBA_CLOUD_FILE_SYSTEMS will show the mounted File Storage after successful attach.

UTL_FILE is enabled only on attached file systems or approved directories.

Limitations & Restrictions

Deployment Restrictions

Not supported on Autonomous Database Shared – public endpoint. OCI File Storage can only be mounted in Oracle Autonomous Database on Dedicated Exadata Infrastructure or Oracle Autonomous Database with private endpoint and proper VCN access. Autonomous Database must be in the same VCN (or peered VCN) as the File Storage mount target.

Network Restrictions

NFS traffic (TCP 111, 2048–2050, 2049) must be allowed in both directions between Autonomous Database subnet and File Storage subnet. If using VCN peering, security rules must allow NFS ports across the peering connection. DNS resolution must be enabled so Autonomous Database can resolve the FQDN of the mount target. No access to File Storage via internet gateway — you must use private routing.

File System Restrictions

Root access is not provided from Autonomous Database; operations are done as the database OS user. You cannot mount more than the Oracle-defined maximum number of file systems (varies by service level). Path length and filename must comply with NFS and Oracle limits (generally ≤255 characters per filename).

Database Restrictions

UTL_FILE operations are restricted to whitelisted directories created via DBMS_CLOUD_ADMIN.CREATE_DIRECTORY_IN_FILE_SYSTEM. You cannot change the NFS mount point manually — it’s managed by Oracle. No OS-level access — all file access must go through SQL, PL/SQL (UTL_FILE, DBMS_CLOUD), or tools like SQL Developer. File I/O performance depends on VCN bandwidth limits and File Storage performance tier.

Operational Restrictions

If the File Storage mount target is deleted or export removed, the mount in Autonomous Database becomes unusable until reconfigured. No direct chmod/chown operations — permissions are managed by the export options in OCI Console. Maximum file size is limited by File Storage service (up to 8 EiB per file system, but individual files must be supported by NFS client limits). High availability depends on multiple mount targets across Availability Domains — Autonomous Database won’t fail over the File Storage automatically.

Attach Network File System to Autonomous Database in Using Oracle Autonomous Database Serverless

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.