DB@AWS · AMAZON EFS · DATA PUMP

Use Amazon EFS with Oracle Autonomous Database Serverless on DB@AWS

Share on LinkedIn ↗

Amazon EFS provides shared file storage that Oracle Autonomous Database Serverless can access through a private network connection.

In this guide, we configure EFS for an existing Oracle Database@AWS deployment, attach a shared directory to the database, and use Oracle Data Pump to export and import 100,000 synthetic accounts receivable invoices.

The final verification compares the original and imported tables: both contain 100,000 invoices, with matching invoiced, paid, and outstanding totals.

How the connection works

The database accesses an EFS mount target in the application VPC through ODB peering. An OCI private DNS record provides the EFS hostname lookup used by the database.

An EC2 instance mounts the same file system so we can prepare the shared folder and inspect files. It does not relay the database’s EFS traffic.

How Autonomous Database uses Amazon EFS
Autonomous Database connects through ODB peering to the EFS mount target. EC2 connects separately to the same EFS folder. The database uses EFS_DPUMP_DIR; EC2 uses /mnt/efs/adbs-dpump. EC2 does not relay database file traffic.

The Windows laptop runs SQL Developer. Its Session Manager tunnel connects to the database listener; EFS access happens separately between the database and the EFS mount target.

Before you begin

This guide continues from the existing DB@AWS deployment. Have the following ready:

The example uses these names:

Component Name
ODB network network-01
EFS file system odb-adbs-efs-lab
EFS security group odb-adbs-efs-nfs
Shared EFS folder /adbs-dpump
Database directory EFS_DPUMP_DIR
Database file system registration AWS_EFS
Source table AR_INVOICES_DEMO
Imported table AR_INVOICES_EFS_RESTORED

Replace network addresses, hostnames, and resource identifiers with your deployment’s values.

1. Create the EFS file system

In the AWS console, open Amazon EFS → File systems → Create file system, then select Customize.

Configure the file system as follows:

Setting Configuration used
Name odb-adbs-efs-lab
File system type Regional
Performance mode General Purpose
Throughput mode Bursting
Encryption at rest Enabled
Automatic backups Disabled
Lifecycle transitions None
EFS file system settings
The deployment uses a Regional EFS file system with encryption at rest and Bursting throughput.

Under Network access, select the application VPC connected to the ODB network.

For this deployment, we created one mount target in the same physical Availability Zone as the database. Check the AZ ID when comparing locations, because AZ letters can differ between accounts.

Configure the mount target’s security group

Create a security group named odb-adbs-efs-nfs in the application VPC.

Add these inbound rules:

Type Protocol Port Source
NFS TCP 2049 ODB client subnet CIDR
NFS TCP 2049 EC2 client security group
EFS security group with both inbound NFS rules
The EFS security group has both inbound NFS rules on TCP 2049: one from the ODB client subnet and one from the EC2 client security group. IP addresses partially masked; use your deployment’s values.

The first rule permits database access through ODB peering. The second permits the EC2 client to mount the same file system.

Check the client security group’s outbound rules too: permit TCP 2049 to the EFS security group. Verify that the application VPC route table has the route back to the ODB client subnet through ODB peering, and that network ACLs permit the connection and its return traffic.

Select this security group for the EFS mount target. For this deployment, we left the optional file system policy blank.

Select odb-adbs-efs-nfs for the EFS mount target in the application VPC.
Select odb-adbs-efs-nfs for the EFS mount target in the application VPC.

Review the configuration and select Create. Wait until both the file system and mount target show Available.

The review screen shows the optional file system policy left blank, with Create available to submit the configuration.
The review screen shows the optional file system policy left blank, with Create available to submit the configuration.

Open the file system’s Network tab and record its mount target’s private IP. Also copy the EFS DNS name from the file system details.

The file system and mount target both show Available. The General panel provides the EFS DNS name; the Network tab shows the mount target address and security group. IP address partially masked; use your deployment’s values.
The file system and mount target both show Available. The General panel provides the EFS DNS name; the Network tab shows the mount target address and security group. IP address partially masked; use your deployment’s values.

2. Configure the database-side DNS record

From the database’s OCI page, open its associated:

VCN → DNS Resolver → Default private view → Private zones

Create a private zone using the exact EFS hostname:

YOUR_EFS_HOSTNAME
Create the private DNS zone using the exact EFS hostname. The hostname shown belongs to this deployment; use your own EFS hostname.
Create the private DNS zone using the exact EFS hostname. The hostname shown belongs to this deployment; use your own EFS hostname.

Inside the zone, open Records → Manage records → Add record.

Configure:

Field Value
Name Blank, for the zone apex
Type A — IPv4 address
TTL 300
Address EFS mount target’s private IP
Add an A record at the zone apex: leave Name blank, use TTL 300, and enter the EFS mount target’s private IP address.
Add an A record at the zone apex: leave Name blank, use TTL 300, and enter the EFS mount target’s private IP address. IP addresses partially masked; use your deployment’s values.

Check that the resulting record name exactly matches the EFS hostname. Select Review changes, then Publish changes.

After publishing, the Records tab shows the EFS hostname with an A record, TTL 300, and the mount target’s private IP address.
After publishing, the Records tab shows the EFS hostname with an A record, TTL 300, and the mount target’s private IP address. IP addresses partially masked; use your deployment’s values.

This mapping provides the database-side hostname lookup used in our deployment. It does not create the network route or grant file permissions.

If the mount target is replaced and its address changes, update this manually maintained record.

3. Mount Amazon EFS on EC2 and prepare the shared folder

Mount EFS on EC2 and prepare the shared folder
EC2 mounts EFS over NFS through the mount target, then prepares the shared folder. Autonomous Database accesses EFS independently; EC2 does not relay its file traffic.

Open the EC2 client through Systems Manager Session Manager.

Run the following commands in the EC2 Linux shell.

First, check that the NFS mount utility is available:

command -v mount.nfs4

Create the local mount point:

sudo mkdir -p /mnt/efs
The EC2 Session Manager shell finds mount.nfs4 and creates the local /mnt/efs mount point.
The EC2 Session Manager shell finds mount.nfs4 and creates the local /mnt/efs mount point.

Mount EFS using the mount target’s private IP:

sudo mount -t nfs4 -o nfsvers=4.1 YOUR_EFS_MOUNT_TARGET_IP:/ /mnt/efs

Confirm the mount:

findmnt /mnt/efs

The output should identify /mnt/efs as an NFS mount. Confirm this before creating the shared folder.

sudo mkdir -p /mnt/efs/adbs-dpump

For the isolated demonstration folder, we used the following shared-write permissions:

sudo chmod 1777 /mnt/efs/adbs-dpump
Create /mnt/efs/adbs-dpump and apply chmod 1777 for this isolated demonstration folder. This capture shows the commands; verify the resulting permissions with ls -ld below.
Create /mnt/efs/adbs-dpump and apply chmod 1777 for this isolated demonstration folder. This capture shows the commands; verify the resulting permissions with ls -ld below.

The sticky bit limits deletion of other users’ files. This is a permissive demonstration setting; use reviewed ownership and permissions for a production shared directory.

Check the result:

ls -ld /mnt/efs/adbs-dpump

These commands mount EFS for the current EC2 session. After an instance restart, check the mount again before using the folder.

4. Attach EFS to Autonomous Database

Connect to the database as ADMIN in SQL Developer.

Permit access to the EFS hostname

Replace the hostname and run:

BEGIN
  DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
    host => 'YOUR_EFS_HOSTNAME',
    ace  => xs$ace_type(
      privilege_list => xs$name_list('connect', 'resolve'),
      principal_name => 'ADMIN',
      principal_type => xs_acl.ptype_db
    )
  );
END;
/
The host ACL block grants ADMIN connect and resolve privileges for the EFS hostname and completes successfully.
The host ACL block grants ADMIN connect and resolve privileges for the EFS hostname and completes successfully.

Configure outbound connections through the private endpoint:

ALTER DATABASE PROPERTY SET
  ROUTE_OUTBOUND_CONNECTIONS = 'ENFORCE_PRIVATE_ENDPOINT';
SQL Developer reports Database altered after setting ROUTE_OUTBOUND_CONNECTIONS to ENFORCE_PRIVATE_ENDPOINT.
SQL Developer reports Database altered after setting ROUTE_OUTBOUND_CONNECTIONS to ENFORCE_PRIVATE_ENDPOINT.

Create the database directory:

CREATE DIRECTORY EFS_DPUMP_DIR AS 'efs_dpump';
SQL Developer confirms that directory EFS_DPUMP_DIR was created.
SQL Developer confirms that directory EFS_DPUMP_DIR was created.

Attach the prepared EFS folder:

BEGIN
  DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM(
    file_system_name     => 'AWS_EFS',
    file_system_location => 'YOUR_EFS_HOSTNAME:/adbs-dpump',
    directory_name       => 'EFS_DPUMP_DIR',
    description          => 'EFS staging folder for Data Pump dump files',
    params               => JSON_OBJECT('nfs_version' VALUE 4)
  );
END;
/
ATTACH_FILE_SYSTEM registers AWS_EFS against the /adbs-dpump folder using EFS_DPUMP_DIR and NFS version 4. The PL/SQL procedure completes successfully.
ATTACH_FILE_SYSTEM registers AWS_EFS against the /adbs-dpump folder using EFS_DPUMP_DIR and NFS version 4. The PL/SQL procedure completes successfully.

Confirm the registration:

SELECT file_system_name,
       file_system_location,
       directory_name,
       nfs_version
FROM dba_cloud_file_systems
WHERE file_system_name = 'AWS_EFS';

Verify that the database can write a file

Run this in SQL Developer:

DECLARE
  l_file UTL_FILE.FILE_TYPE;
BEGIN
  l_file := UTL_FILE.FOPEN(
    'EFS_DPUMP_DIR',
    'adbs_efs_write_test.txt',
    'w'
  );

  UTL_FILE.PUT_LINE(l_file, 'Hello from ADBSLAB01');
  UTL_FILE.FCLOSE(l_file);
END;
/
Write the EFS test file from SQL Developer
Run the UTL_FILE block in SQL Developer to write adbs_efs_write_test.txt into EFS_DPUMP_DIR. The EC2 readback below verifies the file contents.

Then read the file from the EC2 Linux shell:

cat /mnt/efs/adbs-dpump/adbs_efs_write_test.txt

Our result was:

Hello from ADBSLAB01
The EC2 shell reads adbs_efs_write_test.txt from the shared EFS folder and returns Hello from ADBSLAB01.
The EC2 shell reads adbs_efs_write_test.txt from the shared EFS folder and returns Hello from ADBSLAB01.

This confirmed that the database and EC2 client could access the same shared folder.

5. Prepare the sample accounts receivable data

We reused AR_INVOICES_DEMO from the S3 integration walkthrough. If you already have that table, keep it and skip the creation script below. For a fresh deployment, first confirm that the name is unused:

SELECT object_name, object_type
FROM user_objects
WHERE object_name = 'AR_INVOICES_DEMO';

When the query returns no rows, create the synthetic data as ADMIN:

CREATE TABLE ar_invoices_demo AS
WITH synthetic_data AS (
  SELECT
    LEVEL AS invoice_id,
    'INV-' || TO_CHAR(LEVEL, 'FM00000000') AS invoice_number,
    MOD(LEVEL - 1, 500) + 1 AS customer_id,
    'Demo Customer ' ||
      TO_CHAR(MOD(LEVEL - 1, 500) + 1, 'FM0000') AS customer_name,
    DATE '2026-01-01' +
      TRUNC(DBMS_RANDOM.VALUE(0, 300)) AS invoice_date,
    ROUND(DBMS_RANDOM.VALUE(100, 50000), 2) AS invoice_amount,
    TRUNC(DBMS_RANDOM.VALUE(1, 5)) AS payment_category
  FROM dual
  CONNECT BY LEVEL <= 100000
),
payment_data AS (
  SELECT
    invoice_id, invoice_number, customer_id, customer_name,
    invoice_date, invoice_date + 30 AS due_date,
    'USD' AS currency_code,
    invoice_amount,
    CASE payment_category
      WHEN 1 THEN invoice_amount
      WHEN 2 THEN ROUND(invoice_amount * 0.50, 2)
      ELSE 0
    END AS paid_amount
  FROM synthetic_data
)
SELECT
  invoice_id, invoice_number, customer_id, customer_name,
  invoice_date, due_date, currency_code,
  invoice_amount, paid_amount,
  invoice_amount - paid_amount AS outstanding_amount,
  CASE
    WHEN paid_amount = invoice_amount THEN 'PAID'
    WHEN paid_amount > 0 THEN 'PARTIALLY PAID'
    ELSE 'UNPAID'
  END AS payment_status
FROM payment_data;

The table contains 100,000 synthetic invoices across 500 demo customers, including invoice dates, due dates, invoice amounts, payments, outstanding balances, and payment status.

The sample was generated with CONNECT BY LEVEL to create rows and DBMS_RANDOM to produce varying dates and amounts.

Check the source data in SQL Developer:

SELECT COUNT(*) AS invoice_count,
       COUNT(DISTINCT customer_id) AS customer_count,
       SUM(invoice_amount) AS total_invoiced,
       SUM(paid_amount) AS total_paid,
       SUM(outstanding_amount) AS total_outstanding
FROM ar_invoices_demo;

Keep these results for comparison after the import. Randomly generated datasets can have different financial totals.

6. Export the table directly to EFS

Run the following script in SQL Developer using Run Script — F5.

Both the dump file and export log are written directly to EFS_DPUMP_DIR.

SET SERVEROUTPUT ON

DECLARE
  l_handle NUMBER;
  l_state  VARCHAR2(30);
BEGIN
  l_handle := DBMS_DATAPUMP.OPEN(
    operation => 'EXPORT',
    job_mode  => 'TABLE'
  );

  DBMS_DATAPUMP.ADD_FILE(
    handle    => l_handle,
    filename  => 'ar_invoices_efs_export.dmp',
    directory => 'EFS_DPUMP_DIR',
    filetype  => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
  );

  DBMS_DATAPUMP.ADD_FILE(
    handle    => l_handle,
    filename  => 'ar_invoices_efs_export.log',
    directory => 'EFS_DPUMP_DIR',
    filetype  => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE
  );

  DBMS_DATAPUMP.METADATA_FILTER(
    handle => l_handle,
    name   => 'SCHEMA_EXPR',
    value  => 'IN (''ADMIN'')'
  );

  DBMS_DATAPUMP.METADATA_FILTER(
    handle      => l_handle,
    name        => 'NAME_EXPR',
    value       => 'IN (''AR_INVOICES_DEMO'')',
    object_path => 'TABLE'
  );

  DBMS_DATAPUMP.START_JOB(l_handle);
  DBMS_DATAPUMP.WAIT_FOR_JOB(l_handle, l_state);

  DBMS_OUTPUT.PUT_LINE('Export job state: ' || l_state);
END;
/

The export returned:

Export job state: COMPLETED
Data Pump export to EFS completed
Data Pump successfully exported the accounts receivable table directly to the attached EFS directory.

Check the generated files:

SELECT object_name, bytes
FROM DBMS_CLOUD.LIST_FILES('EFS_DPUMP_DIR')
WHERE object_name IN (
  'ar_invoices_efs_export.dmp',
  'ar_invoices_efs_export.log'
)
ORDER BY object_name;
Dump file and export log listed in EFS
The attached directory contained the 8,998,912-byte dump file and its export log.

7. Import the dump file from EFS

We import into a different table name so the original data remains available for comparison.

First, confirm that the target name is unused:

SELECT object_name, object_type
FROM user_objects
WHERE object_name = 'AR_INVOICES_EFS_RESTORED';

For the first run, this should return no rows.

Run the import script:

SET SERVEROUTPUT ON

DECLARE
  l_handle NUMBER;
  l_state  VARCHAR2(30);
BEGIN
  l_handle := DBMS_DATAPUMP.OPEN(
    operation => 'IMPORT',
    job_mode  => 'TABLE'
  );

  DBMS_DATAPUMP.ADD_FILE(
    handle    => l_handle,
    filename  => 'ar_invoices_efs_export.dmp',
    directory => 'EFS_DPUMP_DIR',
    filetype  => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
  );

  DBMS_DATAPUMP.ADD_FILE(
    handle    => l_handle,
    filename  => 'ar_invoices_efs_import.log',
    directory => 'EFS_DPUMP_DIR',
    filetype  => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE
  );

  DBMS_DATAPUMP.METADATA_FILTER(
    handle => l_handle,
    name   => 'SCHEMA_EXPR',
    value  => 'IN (''ADMIN'')'
  );

  DBMS_DATAPUMP.METADATA_FILTER(
    handle      => l_handle,
    name        => 'NAME_EXPR',
    value       => 'IN (''AR_INVOICES_DEMO'')',
    object_path => 'TABLE'
  );

  DBMS_DATAPUMP.METADATA_REMAP(
    handle    => l_handle,
    name      => 'REMAP_TABLE',
    old_value => 'AR_INVOICES_DEMO',
    value     => 'AR_INVOICES_EFS_RESTORED'
  );

  DBMS_DATAPUMP.START_JOB(l_handle);
  DBMS_DATAPUMP.WAIT_FOR_JOB(l_handle, l_state);

  DBMS_OUTPUT.PUT_LINE('Import job state: ' || l_state);
END;
/

The import returned:

Import job state: COMPLETED

This test exported and imported within the same database, using EFS as shared file storage and a separate target table.

8. Verify the imported data

Compare the invoice counts and financial totals:

SELECT 'ORIGINAL' AS table_source,
       COUNT(*) AS invoice_count,
       SUM(invoice_amount) AS total_invoiced,
       SUM(paid_amount) AS total_paid,
       SUM(outstanding_amount) AS total_outstanding
FROM ar_invoices_demo

UNION ALL

SELECT 'EFS_RESTORED',
       COUNT(*),
       SUM(invoice_amount),
       SUM(paid_amount),
       SUM(outstanding_amount)
FROM ar_invoices_efs_restored;
Original and EFS-imported table results
Both tables contained 100,000 invoices, with matching invoiced, paid, and outstanding totals.

These checks confirmed the row count and financial aggregates for the imported table.

Verified result

We configured Amazon EFS as shared storage for Oracle Autonomous Database Serverless on DB@AWS.

The completed workflow covered EFS creation, private connectivity through ODB peering, database-side DNS, shared-folder permissions, and attachment through DBMS_CLOUD_ADMIN.

Oracle Data Pump then exported 100,000 synthetic invoices directly to EFS and imported the dump file into a separate table. The original and imported tables returned matching invoice counts and financial totals.

DNS observation

The AWS console showed the EFS mount target with a private 10.x.x.x address. A hostname lookup through UTL_INADDR.GET_HOST_ADDRESS inside Autonomous Database returned a different address in the 254.x.x.x range.

Database-side EFS hostname lookup with partially masked result
The UTL_INADDR.GET_HOST_ADDRESS lookup in Autonomous Database returned an address in the 254.x.x.x range. IP address partially masked. This records the lookup result; it does not establish why that address was returned.

Despite that difference, the database successfully attached EFS, wrote a file, exported a dump file, and imported it.

We have not confirmed why the database-side lookup returned a different address. We are recording the observed behavior without attributing it to a specific internal networking mechanism.

References

Share on LinkedIn ↗

Join the discussion

Ask a question, share a result, or add a useful tip.

Loading comments…

Leave a comment

Your name and comment will be public. Keep passwords, email addresses, IP addresses, and other private details out of your comment. Cloudflare Turnstile checks submissions to help prevent spam.