Introduction
External tables allow applications to query files in place, without first loading or duplicating their data in the database. In this walkthrough, an OCI File Storage file system is exposed through an NFSv3 mount target, mounted on a compute instance, and attached to Oracle Autonomous AI Database Serverless (ADB-S) as a database directory.
This walkthrough demonstrates a private, file-based integration pattern. An application or operational process writes CSV files to shared storage, and ADB-S queries those files through an external table. The following sections cover File Storage provisioning, the Linux mount, the ADB-S attachment, and external-table creation and validation in Data Studio.
Architecture Overview
This article uses the following terminology:
- OCI File Storage is the managed service, commonly abbreviated as FSS.
- NFS is the network file-system protocol used to access the service.
In the steps that follow, FSS refers to the OCI service, while NFSv3 refers to the protocol used to mount it.
The diagram below shows the architecture. A Linux compute instance generates or stages files on OCI File Storage. ADB-S attaches the same file system as a database directory and exposes its files through an external table. The compute instance and ADB-S are both NFS clients.

A common use case is an operational application that publishes a periodic CSV extract, such as insurance-policy updates, to OCI File Storage. ADB-S exposes the file through an external table, allowing SQL validation and reporting without a separate ingestion job. The application should publish each file atomically so that the database never reads a partially written file.
File System and Mount Target Creation
OCI File Storage provides durable, managed shared storage. Clients access a file system through an export hosted on a mount target. Oracle recommends placing the mount target and the ADB-S private endpoint in separate subnets, with routing and DNS connectivity between them. For simplicity, this walkthrough places them in the same subnet.
Before creating the file system, configure the VCN security rules required by OCI File Storage. Oracle’s current File Storage networking documentation defines the applicable rules for same-subnet and different-subnet deployments.
In this scenario both the Linux instance and the ADB-S private endpoint are NFS clients. On the client side, allow outbound NFS traffic from each client to the mount target. On the mount-target side, allow inbound NFS traffic from both clients. If the clients are in different subnets, make sure the ingress rules cover both client CIDR blocks.
Specify the instance IP address or CIDR block as the source for ingress rules:
- Mount-target ingress: allow stateful TCP traffic from the applicable client CIDR blocks to destination ports 111, 2048, 2049, and 2050.
- Mount-target ingress: allow stateful UDP traffic from the applicable client CIDR blocks to destination ports 111 and 2048.
Specify the mount target IPÂ address or CIDRÂ block as the destination for egress rules:
- NFS-client egress: allow stateful TCP traffic to the destination mount-target CIDR on ports 111, 2048, 2049, and 2050.
- NFS-client egress: allow stateful UDP traffic to the destination mount-target CIDR on ports 111 and 2048.
Restrict the rules to the required source and destination CIDRs rather than using broad ranges in production.
In the OCI Console, open Storage, File Storage, and File Systems, then create an NFS file system. For this walkthrough, name it fsdemo and use Oracle-managed encryption keys. Select the appropriate compartment and availability domain for your environment.

Create the export path /fsdemo. Both the Linux mount command and DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM use this server-side path later in the walkthrough.

Create a mount target named mtdemo, or select an existing mount target with sufficient capacity. This walkthrough places it in the same private subnet as ADB-S, although any reachable private subnet can be used.

After provisioning completes, confirm that the /fsdemo export is active and associated with mtdemo. The Linux instance and ADB-S will access the same export and files.

Record the mount target private IP address for the Linux mount command and its fully qualified domain name (FQDN) for the ADB-S attachment. Using the FQDN in the database configuration avoids embedding an IP address.

Mount OCI File Storage on a Linux Instance
This walkthrough uses an Oracle Linux 8 compute instance with private network access to the mount target. The instance represents an application host that produces or stages CSV files for ADB-S.
On the Linux instance, sign in as opc, create the local mount directory, and mount the /fsdemo export over NFSv3:
$ sudo mkdir -p /mnt/fsdemo
$ sudo mount -t nfs -o vers=3,proto=tcp <mt_private_ip>:/fsdemo /mnt/fsdemo
To keep the file system mounted after a reboot, add the following entry to /etc/fstab, then reload the mounts:
<mt_private_ip>:/fsdemo /mnt/fsdemo nfs defaults,_netdev,vers=3,proto=tcp 0 0
$ sudo mount -a
OCI File Storage is now mounted at /mnt/fsdemo. Assuming that insurance.csv is available locally, copy it from its source directory to the mounted file system:
$ sudo cp /home/opc/<source_folder>/insurance.csv /mnt/fsdemo/
To automate the copy, add a crontab entry such as the following. This example runs every day at 11:55 p.m.:
55 23 * * * /usr/bin/cp /home/opc/<source_folder>/insurance.csv /mnt/fsdemo/ >> /home/opc/fss_copy.log 2>&1
If writing to /mnt/fsdemo requires elevated privileges, configure the job with sudo crontab -e. Then verify the file’s permissions and visibility:
$ ls -lrt /mnt/fsdemo/
-rw-r--r-- 1 1001 oinstall 4123652 Sep 22 10:09 insurance.csv
Before continuing, confirm that the file is readable through the mount. The publishing process should write each file atomically, for example by writing to a temporary filename and renaming it only after the transfer completes.
The data source does not have to be Linux. Any compute instance that can mount the OCI File Storage export and write files to it can perform this role. For example, a Windows Server instance can be used after its NFS client is enabled and configured. Mount and identity-mapping commands vary by operating system, but the ADB-S attachment and external-table configuration remain the same.
Attach OCI File Storage to ADB-S
ADB-S attaches the NFS export to a database directory object. To access a private OCI File Storage service, ADB-S must use a private endpoint with network and DNS connectivity to the mount target. Run the following commands as ADMIN or as a user with EXECUTE on DBMS_CLOUD_ADMIN and WRITE on the target directory.
CREATE DIRECTORY FSS_DIR AS 'fss';
Here, fss is the directory path in the ADB-S internal file system:
select * from dba_directories where directory_name like 'FSS%';
OWNER DIRECTORY_NAME DIRECTORY_PATH ORIGIN_CON_ID
________ _________________ ______________________________________________________ ________________
SYS FSS_DIR <ADB-managed-directory-path>/fss 438
BEGIN
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM(
file_system_name => 'FSDEMO',
file_system_location => 'mtdemoadz.XXXX.vcndm.oraclevcn.com:/fsdemo',
directory_name => 'FSS_DIR',
description => 'attach OCI file system'
);
END;
/
Verify that ADB-S registered the attachment. DBA_CLOUD_FILE_SYSTEMS returns the logical attachment name, the NFS export location, and the ADB-managed directory path:
SELECT file_system_name, file_system_location, directory_path
FROM dba_cloud_file_systems;
FILE_SYSTEM_NAME FILE_SYSTEM_LOCATION DIRECTORY_PATH
___________________ _________________________________________________ _______________________________________________________
FSDEMO mtdemoadz.XXXX.vcndm.oraclevcn.com:/fsdemo <ADB-managed-directory-path>/fss/
Finally, list the directory contents from ADB-S and confirm that the insurance.csv file is visible. LIST_FILES reads directory metadata without loading the file into a database table:
SELECT * FROM DBMS_CLOUD.LIST_FILES('FSS_DIR') WHERE object_name LIKE '%insur%';
OBJECT_NAME BYTES CHECKSUM CREATED LAST_MODIFIED
___________________________ ___________ ___________ __________ ______________________________________
insurance.csv 4123652 22-SEP-26 10.09.38.524566000 AM GMT
Create and Validate the External Table in Data Studio
Create a dedicated schema named DEMO for the external table. It needs permission to connect, create table metadata, execute DBMS_CLOUD, and read the attached directory. WRITE on DATA_PUMP_DIR is included so Data Studio can create validation logs. Use a strong password and grant only the privileges required in this environment.
CREATE USER DEMO IDENTIFIED BY "<strong-password>";
ALTER USER DEMO QUOTA 100M ON DATA;
GRANT CREATE SESSION, CREATE TABLE TO DEMO;
GRANT EXECUTE ON DBMS_CLOUD TO DEMO;
GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR TO DEMO;
GRANT READ ON DIRECTORY FSS_DIR TO DEMO;
Sign in to Database Actions as ADMIN, open Database Users, locate DEMO, and enable REST access so that the schema can use the browser-based tools. You can also create the schema from the Database Users page.

After enabling REST access, sign out from ADMIN and sign in to Data Studio as DEMO. Open Data Load, select Link Data, and choose File System as the source. Select FSS_DIR, locate insurance.csv, and drag it into the work area. The file remains on OCI File Storage.
For consistency, the external table created in this walkthrough is named INSURANCE_EXT.

Data Studio automatically reads the file format and opens the external-table editor. In Settings, review the table name, file properties, inferred data types, and column mappings. Select the SQL tab to inspect the generated statement, then run a sample validation before creating the table.

Select Start to create the external table. Data Studio validates the sample automatically and reports rejected rows or parsing errors.

Open SQL Developer Web and query INSURANCE_EXT to confirm that it returns the expected rows. ADB-S parses the rows from insurance.csv at query time; it does not copy the source data into standard database storage.

Alternatively, you can create the same external table in SQL by calling the DBMS_CLOUD.CREATE_EXTERNAL_TABLE procedure. The file_uri_list parameter uses the format DIRECTORY_NAME:filename. Because the sample file uses CR-only record terminators, the format specifies hexadecimal 0D explicitly. For files that use LF or CRLF, specify the matching record delimiter or allow DBMS_CLOUD to detect it.
BEGIN
DBMS_CLOUD.CREATE_EXTERNAL_TABLE(
table_name => 'INSURANCE_EXT',
file_uri_list => 'FSS_DIR:insurance.csv',
format => JSON_OBJECT(
'type' VALUE 'csv',
'skipheaders' VALUE 1,
'delimiter' VALUE ',',
'recorddelimiter' VALUE '0x''0D'''
),
column_list => q'[
POLICYID NUMBER,
STATECODE VARCHAR2(2),
COUNTY VARCHAR2(100),
EQ_SITE_LIMIT NUMBER,
HU_SITE_LIMIT NUMBER,
FL_SITE_LIMIT NUMBER,
FR_SITE_LIMIT NUMBER,
TIV_2011 NUMBER,
TIV_2012 NUMBER,
EQ_SITE_DEDUCTIBLE NUMBER,
HU_SITE_DEDUCTIBLE NUMBER,
FL_SITE_DEDUCTIBLE NUMBER,
FR_SITE_DEDUCTIBLE NUMBER,
POINT_LATITUDE NUMBER,
POINT_LONGITUDE NUMBER,
LINE VARCHAR2(50),
CONSTRUCTION VARCHAR2(100),
POINT_GRANULARITY NUMBER
]'
);
END;
/
The validation example below uses rowcount => 100 and stop_on_error => FALSE. The procedure continues until either 100 rows are rejected or 100 rows are validated successfully; it does not necessarily stop after reading exactly 100 source rows. Rejected rows are recorded in the validation logs. See Validate External Data for details.
BEGIN
DBMS_CLOUD.VALIDATE_EXTERNAL_TABLE(
table_name => 'INSURANCE_EXT',
rowcount => 100,
stop_on_error => FALSE
);
END;
/
Because an external table reads its source file at query time, changes to insurance.csv, such as added or removed rows, appear automatically in subsequent queries. You do not need to recreate or refresh the external table as long as the file remains in the same location and its columns, delimiters, and encoding remain compatible with the table definition. If the schema or file format changes, update the external-table definition.
Conclusion
This walkthrough connected one OCI File Storage file system to two clients: a compute instance that writes files over NFSv3 and ADB-S, where the same export is available through the FSS_DIR database directory. Data Studio then created and validated the INSURANCE_EXT external table without copying the CSV data into a standard database table.
This pattern is useful when applications already exchange files through private shared storage or when data must remain on a file system. In production, restrict NFS traffic with NSGs or security lists, validate file schemas and record delimiters, monitor rejected rows, and publish files atomically so that consumers never query partial data.
