DB@AWS · AMAZON S3 · DATA PUMP

Integrate Amazon S3 with Oracle Autonomous Database Serverless on DB@AWS

Share on LinkedIn ↗

Use Amazon S3 as a staging location for Oracle Data Pump files, then bring the data back into Oracle Autonomous Database Serverless on DB@AWS. This guide walks through creating the bucket, enabling the ODB network's S3 integration, configuring access, and running the export and import from SQL Developer.

For the test, we generate 100,000 synthetic Accounts Receivable invoices across 500 fictional customers. We export the table, upload the dump to S3, download it under a new filename, and import it as a second table. The final comparison verifies the row counts, financial totals, and every distinct row in both directions.

We export the table to S3, then import it into a new table in the same database and verify that the data matches.

1. Understand the connection flow

The database uses DBMS_CLOUD to send HTTPS requests to S3 through the ODB network's managed S3 integration. The bucket stores the dump file as an object; no S3 filesystem mount is needed. Oracle describes this integration for Serverless in its Amazon S3 migration guide.

Autonomous Database
AR_INVOICES_DEMO
→Data Pump export
DATA_PUMP_DIR
→Amazon S3
ar_invoices_demo.dmp
→Download and import
AR_INVOICES_RESTORED

There are three access layers to configure:

Layer What it controls
ODB network S3 integration The managed connection and the S3 requests allowed through it.
IAM and organization policies Which actions the lab identity may perform. An applicable SCP Deny overrides an IAM Allow.
Database credential The AWS access key ID and matching secret used by DBMS_CLOUD.

SQL Developer connects from Windows through our existing SSM tunnel. S3 transfers originate from the database; the tunnel provides the SQL session used to run the commands.

2. Prerequisites and lab values

Start with the network, database, wallet, and SQL Developer connection from the earlier guide: Provision Oracle Autonomous Database Serverless on AWS with Terraform and GitHub Actions.

You need access to create an S3 bucket and a bucket-scoped IAM identity, modify the ODB network integration, and run the SQL as ADMIN. If an organization policy restricts the workload account, its administrator must review the required access.

Component Value used in this guide
Region us-east-1
Existing ODB network network-01
SQL Developer connection ADBSLAB01
IAM user odb-adbs-s3-lab
IAM policy odb-adbs-s3-lab-readwrite
Database credential AWS_S3_CRED
Source table AR_INVOICES_DEMO
Restored table AR_INVOICES_RESTORED

In the commands below, replace YOUR_LAB_BUCKET with your globally unique bucket name and <AWS_ACCOUNT_ID> with your workload account ID. Use the same bucket name throughout. Run SQL scripts with F5 in SQL Developer.

3. Create the S3 bucket

In the workload AWS account, open Amazon S3 → Buckets → Create bucket. Use these settings:

Setting Selection
Region US East (N. Virginia), us-east-1
Bucket type General purpose
Bucket namespace Global namespace, as used in this lab
Bucket name Your unique lab bucket name
Object Ownership ACLs disabled; bucket owner enforced
Block Public Access Block all public access
Bucket Versioning Disable
Default encryption SSE-S3, Amazon S3 managed keys

Keep tags optional and leave Object Lock off for this disposable test. Select Create bucket.

S3 bucket creation settings
Create a general-purpose bucket with public access blocked and SSE-S3 encryption.

4. Enable the ODB network S3 integration

Open Oracle Database@AWS → ODB networks → network-01 → Modify. Under Configure service integrations, select Amazon S3 and enter the following auth policy, replacing both bucket references:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowLabBucketListing",
      "Effect": "Allow",
      "Principal": "*",
      "Action": ["s3:ListBucket", "s3:GetBucketLocation"],
      "Resource": "arn:aws:s3:::YOUR_LAB_BUCKET"
    },
    {
      "Sid": "AllowLabObjectReadWrite",
      "Effect": "Allow",
      "Principal": "*",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::YOUR_LAB_BUCKET/*"
    },
    {
      "Sid": "DenyOtherBuckets",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "NotResource": [
        "arn:aws:s3:::YOUR_LAB_BUCKET",
        "arn:aws:s3:::YOUR_LAB_BUCKET/*"
      ]
    }
  ]
}

This policy allows listing, reading, and uploading for this bucket through the integration. The final statement blocks access to other buckets through that integration, so review its scope if the ODB network serves other databases.

The policy is configured on the ODB network integration, not as a public bucket policy. Principal: "*" here does not make the bucket public; requests still require authentication and permissions. Keep Block all public access enabled on the bucket.

Preserve the network name and peered CIDRs. Leave the other service integrations unchanged. Choose Continue → review the modification → Modify. Open Service integrations and confirm that Amazon S3 shows Enabled. This is separate from Oracle-managed backup access. See AWS managed S3 access.

Amazon S3 enabled on the ODB network

Under Service integrations, the Amazon S3 section shows Enabled and the regional S3 domain. Account, resource, and IP details are masked.

If Terraform manages your ODB network, record this console change and reconcile it with that configuration before a later network apply.

5. Create the bucket-scoped IAM policy and user

Open IAM → Policies → Create policy → JSON and enter:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListLabBucket",
      "Effect": "Allow",
      "Action": ["s3:ListBucket", "s3:GetBucketLocation"],
      "Resource": "arn:aws:s3:::YOUR_LAB_BUCKET"
    },
    {
      "Sid": "ReadWriteLabObjects",
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::YOUR_LAB_BUCKET/*"
    }
  ]
}

Name it odb-adbs-s3-lab-readwrite and create it.

IAM confirms creation of the bucket-scoped policy
The customer-managed policy odb-adbs-s3-lab-readwrite has been created.

Then open IAM → Users → Create user:

  1. Enter odb-adbs-s3-lab.
  2. Leave AWS console access disabled.
  3. Choose Attach policies directly and select odb-adbs-s3-lab-readwrite.
  4. Review and create the user.
Attach the S3 policy to the lab IAM user

Select Attach policies directly, then check odb-adbs-s3-lab-readwrite before continuing.

The policy grants listing, reading, and uploading only for the lab bucket. It does not include object deletion.

Open the user's Security credentials → Create access key. In this lab we selected Other, entered a description identifying the DBMS_CLOUD S3 lab, and created the key. Save the access key ID and its matching secret access key privately. The ID goes into the credential's username; the secret goes into password.

Retrieve the AWS access key ID and secret access key

The Retrieve access keys screen provides the access key ID and its matching secret access key. Both values are masked here.

6. Review the regional SCP if your organization uses one

In this lab, SQL Developer returned ORA-20403: Authorization failed for URI when we tested the S3 bucket. That message alone does not identify which permission check failed.

SQL Developer reports ORA-20403 when listing the S3 bucket

SQL Developer reports ORA-20403: Authorization failed for URI. We used the CLI check below to identify the underlying SCP deny.

We tested the same credentials with the AWS CLI. It returned AccessDenied for ListObjectsV2, explicitly stating that s3:ListBucket was blocked with an explicit deny in a service control policy. This identified the organization policy as the restriction, even though the user's IAM policy allowed the bucket operation.

AWS CLI AccessDenied error identifying an explicit SCP deny
The CLI error identifies an explicit SCP deny. Account, bucket, and organization identifiers are masked.

An IAM Allow cannot override an applicable SCP Deny. If you see this error, have your organization administrator review the applicable SCP before changing the bucket or database credential. Other authorization errors can have different causes.

In the management account, we opened AWS Organizations → Policies → Service control policies → AdvancedModeRegionRestrictionSecurityControlPolicy, backed up its JSON, and located the UsEast1Partitional Deny statement.

Its ArnNotLike condition lists principals exempt from that regional Deny. Here is the before-and-after change, with the account ID masked.

Before:

"ArnNotLike": {
  "aws:PrincipalArn": [
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/managed/AccountFullAccessRole",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/odbnet-github-plan",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/odbnet-github-apply",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/adbs-github-plan",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/adbs-github-apply",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/odbnet-client"
  ]
}

After:

"ArnNotLike": {
  "aws:PrincipalArn": [
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/managed/AccountFullAccessRole",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/odbnet-github-plan",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/odbnet-github-apply",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/adbs-github-plan",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/adbs-github-apply",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:role/odbnet-client",
    "arn:aws:iam::<AWS_ACCOUNT_ID>:user/odb-adbs-s3-lab"
  ]
}

Only the final user ARN was added. The other statements and conditions stayed unchanged. The exemption removes this regional Deny for that user; the bucket-scoped IAM policy still defines its allowed S3 operations. These are excerpts of our organization's policy, not a replacement SCP. Your organization administrator should review the appropriate exception for your environment.

7. Connect SQL Developer and create the S3 credential

Start the existing database and EC2 client, confirm that Systems Manager shows the client Online, and open the SSM remote-host tunnel from the earlier guide. Connect to ADBSLAB01 as ADMIN using its wallet.

In a new worksheet, run the following script with F5. Paste the access key ID and secret into their separate hidden prompts:

SET ECHO OFF
SET VERIFY OFF
SET DEFINE ON

ACCEPT s3_access_key CHAR PROMPT 'AWS ACCESS KEY ID: ' HIDE
ACCEPT s3_secret_key CHAR PROMPT 'AWS SECRET ACCESS KEY: ' HIDE

BEGIN
  DBMS_CLOUD.CREATE_CREDENTIAL(
    credential_name => 'AWS_S3_CRED',
    username        => TRIM('&s3_access_key'),
    password        => TRIM('&s3_secret_key')
  );
END;
/

UNDEFINE s3_access_key
UNDEFINE s3_secret_key

TRIM removes accidental spaces at either end of a pasted value. Use a matching key pair. If AWS_S3_CRED already exists, update it or remove and recreate it intentionally rather than rerunning the creation script unchanged. See Oracle's DBMS_CLOUD reference.

S3 credential created without displaying keys
The script uses hidden prompts and returns successful completion without displaying the key values.

8. Test access to the empty bucket

Run:

SELECT object_name, bytes
FROM DBMS_CLOUD.LIST_OBJECTS(
  credential_name => 'AWS_S3_CRED',
  location_uri =>
    'https://s3.us-east-1.amazonaws.com/YOUR_LAB_BUCKET/'
);

An empty bucket returns no rows selected without an authorization error. We also verified the same IAM identity with the AWS CLI. For an optional CLI check, configure a dedicated profile privately, then list the bucket:

aws configure --profile s3-lab-test
aws s3api list-objects-v2 --bucket YOUR_LAB_BUCKET --max-keys 5 --profile s3-lab-test --region us-east-1

Our empty-bucket result showed KeyCount: 0. Keep key-entry screens out of screenshots.

Successful empty-bucket checks in SQL Developer and PowerShell

Top: SQL Developer returns no rows selected, with no error. Bottom: the AWS CLI returns KeyCount: 0. Both checks succeeded because the bucket was empty at this stage. Bucket and account details are masked.

9. Generate 100000 synthetic AR invoices

Create a fictional Accounts Receivable dataset. The CONNECT BY clause expands it to 100,000 invoices. DBMS_RANDOM supplies invoice dates, amounts, and payment categories.

How the synthetic data is generated

CONNECT BY LEVEL <= 100000 supplies the rows; change 100000 to the number of test invoices you need. LEVEL gives each invoice a unique ID. The following expressions fill those rows with fictional values:

Expression Purpose
ROUND(DBMS_RANDOM.VALUE(100, 50000), 2) Generate an invoice amount, rounded to two decimal places.
DATE '2026-01-01' + TRUNC(DBMS_RANDOM.VALUE(0, 300)) Choose a date from January 1 through October 27, 2026.
TRUNC(DBMS_RANDOM.VALUE(1, 5)) Generate a payment category from 1 to 4.
MOD(LEVEL - 1, 500) + 1 Cycle through 500 fictional customer IDs.

DBMS_RANDOM.VALUE(low, high) includes the lower bound and excludes the upper bound; rounding can bring an amount to the displayed upper limit. This creates synthetic test data rather than copying customer records. Adjust the ranges and row count to suit your test.

See Oracle's DBMS_RANDOM documentation for random numbers, strings, and seeding. The hierarchical query documentation explains CONNECT BY and LEVEL. We did not set a fixed seed in this lab, so generated values and totals can differ between runs.

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;
Synthetic AR invoice table created
Oracle created the sample table containing fictional invoice data.

Check the source counts and financial totals before export:

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;
Source invoice counts and financial totals
The source has 100,000 invoices and 500 customers. Your random financial totals will differ; keep them for comparison after import.

10. Export the table to a Data Pump dump file

Run this script to export only ADMIN.AR_INVOICES_DEMO into DATA_PUMP_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_demo.dmp',
    directory => 'DATA_PUMP_DIR',
    filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
  );

  DBMS_DATAPUMP.ADD_FILE(
    handle => l_handle,
    filename => 'ar_invoices_demo_export.log',
    directory => 'DATA_PUMP_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;
/
Data Pump export completed
The export reported COMPLETED. The dump and export log are in the database's DATA_PUMP_DIR.

Use new filenames for another test run if these files already exist.

11. Upload the dump file to S3

Use the file-based overload of DBMS_CLOUD.PUT_OBJECT:

BEGIN
  DBMS_CLOUD.PUT_OBJECT(
    credential_name => 'AWS_S3_CRED',
    object_uri =>
      'https://s3.us-east-1.amazonaws.com/YOUR_LAB_BUCKET/ar_invoices_demo.dmp',
    directory_name => 'DATA_PUMP_DIR',
    file_name => 'ar_invoices_demo.dmp'
  );
END;
/
Successful dump file upload to S3
DBMS_CLOUD.PUT_OBJECT uploads ar_invoices_demo.dmp from DATA_PUMP_DIR to S3 and returns successful completion.

After successful completion, verify the stored object:

SELECT object_name, bytes
FROM DBMS_CLOUD.LIST_OBJECTS(
  credential_name => 'AWS_S3_CRED',
  location_uri =>
    'https://s3.us-east-1.amazonaws.com/YOUR_LAB_BUCKET/'
)
WHERE object_name = 'ar_invoices_demo.dmp';

You can also open S3 → your bucket → Objects and refresh, or repeat the CLI listing command from step 8. Our CLI result showed ar_invoices_demo.dmp, 8,998,912 bytes, and storage class STANDARD.

12. Download the dump file from S3

Download the object under a different filename so the import uses the file retrieved from S3:

BEGIN
  DBMS_CLOUD.GET_OBJECT(
    credential_name => 'AWS_S3_CRED',
    object_uri =>
      'https://s3.us-east-1.amazonaws.com/YOUR_LAB_BUCKET/ar_invoices_demo.dmp',
    directory_name => 'DATA_PUMP_DIR',
    file_name => 'ar_invoices_from_s3.dmp'
  );
END;
/

The call returned PL/SQL procedure successfully completed. The downloaded file is now ready for Data Pump import.

Successful dump file download from S3
DBMS_CLOUD.GET_OBJECT retrieves the S3 object as ar_invoices_from_s3.dmp in DATA_PUMP_DIR.

13. Import into a new table

Use REMAP_TABLE to restore the exported table as AR_INVOICES_RESTORED, preserving the source for comparison:

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_from_s3.dmp',
    directory => 'DATA_PUMP_DIR',
    filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
  );

  DBMS_DATAPUMP.ADD_FILE(
    handle => l_handle,
    filename => 'ar_invoices_s3_import.log',
    directory => 'DATA_PUMP_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_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;
/
Data Pump import completed
The import reported COMPLETED, creating the restored table from the downloaded dump.

14. Verify the restored financial data

Compare both tables' counts and totals, then check for row differences in each direction:

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 'RESTORED', COUNT(*), SUM(invoice_amount),
       SUM(paid_amount), SUM(outstanding_amount)
FROM ar_invoices_restored;

SELECT COUNT(*) AS missing_or_changed_rows
FROM (
  SELECT * FROM ar_invoices_demo
  MINUS
  SELECT * FROM ar_invoices_restored
);

SELECT COUNT(*) AS extra_or_changed_rows
FROM (
  SELECT * FROM ar_invoices_restored
  MINUS
  SELECT * FROM ar_invoices_demo
);
Original and restored AR data match
Both tables contain 100,000 invoices, their financial totals match, and both difference checks return zero.

The source's generated invoice_id is unique for each row. For this dataset, the matching counts and bidirectional MINUS results verify the table data after the S3 round trip. This check covers the data, rather than a complete comparison of every possible schema object.

Conclusion

We integrated Amazon S3 with Oracle Autonomous Database Serverless on DB@AWS and used it to stage a Data Pump dump containing 100,000 synthetic AR invoices. The database exported the source table, uploaded the dump, retrieved it from S3, and imported it into a new table.

The final checks confirmed matching invoice counts and financial totals, with zero row differences. With the ODB integration, scoped permissions, and database credential in place, S3 provides a staging location for table export and import workflows from SQL Developer.

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.