top of page

RMAN Backups to Object Storage on OCI, AWS, Azure and Google Cloud

OmerNarman
Aug 14
11 min read

Updated: Oct 24

Object storage is the right home for Oracle backups in every cloud: it is cheap, durable, replicated across fault domains, and it can be locked so that neither a mistake nor ransomware can delete the backups. Getting RMAN to write there properly takes about an afternoon per platform.


This post walks through the full setup on OCI, then the same pattern on AWS, and the working options for Amazon RDS, Azure and Google Cloud. It finishes with the settings and checks that separate a backup that exists from a backup that restores.



The Use Case

A mixed estate wants one backup standard for every Oracle database, wherever it runs:


  • RMAN, with a weekly level 0 and a daily level 1 incremental backup.

  • Archived redo logs backed up every run.

  • All backups encrypted and compressed.

  • Written to object storage in the cloud nearest the database.

  • A 35-day recovery window, with the bucket locked against deletion for that period.

  • A restore test that runs automatically and records how long it took.


Environment used in this runbook


  • Database: Oracle Database 19c (19.22), single instance PROD on an OCI compute instance

  • Region: OCI eu-frankfurt-1

  • Bucket: db-backups-prod, Standard tier

  • Backup module: Oracle Database Cloud Backup Module for OCI (oci_install.jar)

  • Second site: a self-managed 19c database on Amazon EC2 in eu-central-1, backing up to S3



How It Works

RMAN writes to tape-like devices (SBT, System Backup to Tape) through a media management library. Oracle ships cloud backup modules that are such a library: RMAN thinks it is writing to tape, and the library sends the backup pieces to object storage over HTTPS.


  • OCI: Oracle Database Cloud Backup Module for OCI, library libopc.so.

  • AWS: Oracle Secure Backup Cloud Module for Amazon S3, library libosbws.so.

  • Azure and Google Cloud: there is no Oracle module of their own; the patterns are described later in this post.


The OCI managed services (Base Database, Exadata Database Service and Autonomous Database, including Oracle Database@Azure, @Google Cloud and @AWS) configure all of this for you from the console. The steps below are for self-managed databases on cloud VMs or on premises.



Step 1: Create the Bucket and Lock It with a Retention Rule

Create the bucket first, then add a retention rule. A retention rule stops anyone, including administrators, from deleting or overwriting an object until it is older than the rule's period. Once the rule is locked, it cannot be removed or shortened.


Shell

oci os bucket create \

--compartment-id ocid1.compartment.oc1..example \

--name db-backups-prod \

--storage-tier Standard \

--versioning Disabled

oci os retention-rule create \

--bucket-name db-backups-prod \

--display-name keep-35-days \

--time-amount 35 \

--time-unit DAYS

oci os retention-rule list --bucket-name db-backups-prod \

--query 'data.items[].{name:"display-name",days:duration."time-amount",locked:"time-rule-locked"}' \

--output table

Expected output

+--------------+------+--------+
| name         | days | locked |
+--------------+------+--------+
| keep-35-days | 35   | None   |
+--------------+------+--------+

What to expect: The bucket is created and the 35-day rule is in place but not yet locked (locked is None). Leave it unlocked until the first backups and a restore have worked. Then lock it with oci os retention-rule update --time-rule-locked, which takes effect after a 14-day delay during which it can still be cancelled.


Tip: Match the retention rule to the RMAN recovery window. If the rule is longer than the window, RMAN's DELETE OBSOLETE fails on pieces that are still locked. If it is shorter, the newest backups are not protected for the whole window.


Step 2: Create a Backup User and an API Key

The backup module signs its requests with an OCI API key. Give it a dedicated user in a group that can manage objects in this bucket only. Never use a personal administrator account.


Shell

# Generate the API signing key pair on the database host

mkdir -p /u01/app/oracle/opc && cd /u01/app/oracle/opc

openssl genrsa -out oci_api_key.pem 2048

chmod 600 oci_api_key.pem

openssl rsa -pubout -in oci_api_key.pem -out oci_api_key_public.pem

# Fingerprint to check against the console after uploading the public key

openssl rsa -pubout -outform DER -in oci_api_key.pem 2>/dev/null | openssl md5 -c

Expected output

writing RSA key
MD5(stdin)= 2c:7f:41:9a:d0:5e:13:b8:6a:4c:90:e2:77:1d:3f:a5

What this does: It creates the private key (kept on the database host, readable only by oracle) and the public key you upload to the backup user in the OCI console (Identity > Users > API Keys). The fingerprint the console shows must match this one. The group policy needs two statements: Allow group db-backup to manage objects in compartment backups where target.bucket.name='db-backups-prod', and Allow group db-backup to read buckets in compartment backups.



Step 3: Install the Oracle Database Cloud Backup Module for OCI

Download the module (opc_installer.zip) from Oracle, unzip it, and run oci_install.jar from the oci_installer directory. The installer downloads the library, creates a wallet holding the credentials, and writes a configuration file for RMAN.


Shell

cd /u01/app/oracle/opc/oci_installer

java -jar oci_install.jar \

-host https://objectstorage.eu-frankfurt-1.oraclecloud.com \

-pvtKeyFile /u01/app/oracle/opc/oci_api_key.pem \

-pubFingerPrint 2c:7f:41:9a:d0:5e:13:b8:6a:4c:90:e2:77:1d:3f:a5 \

-uOCID ocid1.user.oc1..example \

-tOCID ocid1.tenancy.oc1..example \

-cOCID ocid1.compartment.oc1..example \

-bucket db-backups-prod \

-walletDir /u01/app/oracle/opc/wallet \

-libDir /u01/app/oracle/opc/lib \

-configFile /u01/app/oracle/opc/opcPROD.ora

Expected output

Oracle Database Cloud Backup Module Install Tool, build 19.3.0.0.0DBBKPCSBP_2026-06-11
Oracle Database Cloud Backup Module credentials are valid.
Backups would be sent to bucket db-backups-prod.
Oracle Database Cloud Backup Module wallet created in directory /u01/app/oracle/opc/wallet.
Oracle Database Cloud Backup Module initialization file /u01/app/oracle/opc/opcPROD.ora created.
Downloading Oracle Database Cloud Backup Module Software Library from Oracle Cloud Infrastructure.
Download complete.

What to expect: "credentials are valid" proves the key, fingerprint and OCIDs are correct and that the user can reach the bucket. If the bucket does not exist, the installer creates it, which is why we created it ourselves in Step 1 with the right tier. Run java -jar oci_install.jar with no parameters to see every option your version supports.



Step 4: Point RMAN at the Module and Set the Policy

The persistent RMAN configuration tells every future backup which library to use and how to behave. Set it once, then keep the backup scripts short.


Shell

rman target /

RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS

'SBT_LIBRARY=/u01/app/oracle/opc/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/u01/app/oracle/opc/opcPROD.ora)';

RMAN> CONFIGURE DEFAULT DEVICE TYPE TO SBT_TAPE;

RMAN> CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;

RMAN> CONFIGURE COMPRESSION ALGORITHM 'BASIC';

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

RMAN> CONFIGURE BACKUP OPTIMIZATION ON;

RMAN> CONFIGURE ENCRYPTION FOR DATABASE ON;

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 35 DAYS;

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DEVICE TYPE SBT_TAPE;

Expected output

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'SBT_LIBRARY=/u01/app/oracle/opc/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/u01/app/oracle/opc/opcPROD.ora)';
new RMAN configuration parameters are successfully stored

new RMAN configuration parameters:
CONFIGURE ENCRYPTION FOR DATABASE ON;
new RMAN configuration parameters are successfully stored

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 35 DAYS;
new RMAN configuration parameters are successfully stored

What this does: Each CONFIGURE prints the new setting (only three are shown above). The cloud module refuses unencrypted backups, so CONFIGURE ENCRYPTION is not optional. With a TDE keystore open, RMAN uses it automatically; without TDE, add SET ENCRYPTION ON IDENTIFIED BY 'password' ONLY to every backup script and store that password with the keystore backups. BASIC compression is included with the database; LOW, MEDIUM and HIGH need the Advanced Compression option.



Step 5: Take the First Level 0 Backup

The first level 0 backup is the baseline every later incremental builds on. Run it at a quiet time and watch the throughput: it shows how long a full restore would take.


Shell

rman target / <<'EOF'

BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG DELETE INPUT TAG 'L0_WEEKLY';

EOF

Expected output

Starting backup at 09-AUG-26
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=412 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Database Backup Service Library VER=19.0.0.1
...
channel ORA_SBT_TAPE_1: starting compressed incremental level 0 datafile backup set
channel ORA_SBT_TAPE_1: finished piece 1 at 09-AUG-26
piece handle=PROD_3k2v8q1a_1_1 tag=L0_WEEKLY comment=API Version 2.0,MMS Version 19.0.0.1
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 01:12:44
Finished backup at 09-AUG-26

Starting Control File and SPFILE Autobackup at 09-AUG-26
piece handle=c-3311908271-20260809-00 comment=API Version 2.0,MMS Version 19.0.0.1
Finished Control File and SPFILE Autobackup at 09-AUG-26

What to expect: Channels of type SBT_TAPE using the Oracle Database Backup Service library, pieces with a comment showing the MMS (media management) version, and a control file autobackup at the end. If the first channel fails with ORA-19511 and KBHS errors, read the module trace in $ORACLE_HOME/rdbms/log or the diagnostic trace directory: it names the HTTP status returned by Object Storage.



Step 6: Check What Landed in the Bucket

Confirm from both sides: RMAN's view of the backups, and the objects in the bucket. The two must agree.


Shell

rman target / <<'EOF'

LIST BACKUP SUMMARY;

EOF

oci os object list --bucket-name db-backups-prod --prefix file_chunk --all \

--query 'length(data)'

Expected output

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
5101    B  A  A SBT_TAPE    09-AUG-26       1       1       YES        L0_WEEKLY
5102    B  0  A SBT_TAPE    09-AUG-26       4       1       YES        L0_WEEKLY
5103    B  A  A SBT_TAPE    09-AUG-26       1       1       YES        L0_WEEKLY
5104    B  F  A SBT_TAPE    09-AUG-26       1       1       NO         TAG20260809T031544

1288

What this does: LIST BACKUP SUMMARY shows the archivelog sets (LV A), the level 0 set and the control file autobackup (LV F), all on SBT_TAPE and available (S A). The module stores each piece as many chunk objects under the file_chunk prefix, which is why there are over a thousand objects for a handful of pieces. Never delete these objects by hand; let RMAN do it.



Step 7: Schedule the Daily Level 1 and Weekly Level 0

Two short scripts and two cron entries give you the full strategy. Level 1 backups read only changed blocks; with block change tracking enabled they do not even scan the unchanged ones.


Shell

# Block change tracking makes level 1 backups fast (Enterprise Edition)

sqlplus -s / as sysdba <<'EOF'

ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/u02/oradata/PROD/bct_prod.chg';

EOF

cat > /u01/app/oracle/scripts/rman_l1.rcv <<'EOF'

BACKUP INCREMENTAL LEVEL 1 DATABASE PLUS ARCHIVELOG DELETE INPUT TAG 'L1_DAILY';

DELETE NOPROMPT OBSOLETE;

EOF

# crontab -e for the oracle user

# 30 1 * * 0 . ~/.bash_profile; rman target / cmdfile=/u01/app/oracle/scripts/rman_l0.rcv log=/u01/app/oracle/logs/rman_l0_$(date +\%F).log

# 30 1 * * 1-6 . ~/.bash_profile; rman target / cmdfile=/u01/app/oracle/scripts/rman_l1.rcv log=/u01/app/oracle/logs/rman_l1_$(date +\%F).log


What this does: Level 0 runs on Sunday at 01:30 and level 1 on the other days. DELETE OBSOLETE removes backups that fall outside the 35-day window, from RMAN's catalogue and from the bucket in one step, so the two never drift apart. Escape the percent signs in crontab, as shown, or cron cuts the line.



Step 8: Do the Same on AWS with the S3 Module

For a self-managed database on EC2 or on premises, the Oracle Secure Backup Cloud Module for Amazon S3 is the equivalent library. It authenticates with an access key pair for an IAM user restricted to one bucket.


Shell

java -jar osbws_install.jar \

-AWSID AKIAEXAMPLEEXAMPLE \

-AWSKey exampleSecretKeyExampleSecretKey \

-walletDir /u01/app/oracle/osbws/wallet \

-libDir /u01/app/oracle/osbws/lib \

-location eu-central-1

rman target /

RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS

'SBT_LIBRARY=/u01/app/oracle/osbws/lib/libosbws.so, SBT_PARMS=(OSB_WS_PFILE=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/osbwsPROD.ora)';

Expected output

Oracle Secure Backup Web Service Install Tool, build 12.2.0.1.0DBBKPCSBP_2026-05-28
AWS credentials are valid.
S3 user already registered.
Registration ID: 4c1e0f8a-5b2d-4e7a-9a61-0d3c2b7e9f14
S3 Logging Bucket: oracle-log-prod-1
Validating log bucket location ...
Validating license file ...
Oracle Secure Backup Web Service wallet created in directory /u01/app/oracle/osbws/wallet.
Oracle Secure Backup Web Service initialization file /u01/app/oracle/product/19.0.0/dbhome_1/dbs/osbwsPROD.ora created.
Downloading Oracle Secure Backup Web Service Software Library from file osbws_linux64.zip.
Download complete.

What to expect: The installer validates the AWS keys, creates the wallet and writes osbws<SID>.ora in $ORACLE_HOME/dbs. Older versions of the installer also ask for Oracle account credentials (-otnUser and -otnPass); run java -jar osbws_install.jar without parameters to see what yours needs. All other RMAN settings from Steps 4 to 7 stay the same. Protect the S3 bucket with S3 Object Lock in compliance mode, the S3 equivalent of a locked retention rule.



Step 9: Amazon RDS for Oracle

RDS gives you no SBT channel and no access to RMAN's media management layer, so the cloud modules do not apply. The supported pattern is:


  • Automated backups and snapshots for point-in-time recovery inside RDS. Set the retention period (up to 35 days) on the instance and copy snapshots to a second region or account with AWS Backup.

  • RMAN to a directory with the rdsadmin.rdsadmin_rman_util procedures, when you need an RMAN-format copy, for example to restore outside RDS.

  • Ship to S3 with the S3 integration option and rdsadmin.rdsadmin_s3_tasks.upload_to_s3.


SQL

-- As the RDS master user: RMAN backup to a directory object

EXEC rdsadmin.rdsadmin_util.create_directory(p_directory_name => 'RMAN_BKP');

BEGIN

rdsadmin.rdsadmin_rman_util.backup_database_full(

p_owner => 'SYS',

p_directory_name => 'RMAN_BKP',

p_parallel => 4,

p_section_size_mb => 10240,

p_rman_to_dbms_output => FALSE);

END;

/

-- Copy the pieces to S3 (needs the S3_INTEGRATION option and an IAM role on the instance)

SELECT rdsadmin.rdsadmin_s3_tasks.upload_to_s3(

p_bucket_name => 'rds-prod-rman',

p_prefix => '',

p_s3_prefix => 'prod/2026-08-10/',

p_directory_name => 'RMAN_BKP') AS task_id

FROM dual;

Expected output

PL/SQL procedure successfully completed.

TASK_ID
-------------------------
1786352112417-512

What to expect: RDS creates the directory on its own file system (CREATE DIRECTORY is not allowed for the master user). The backup procedure writes RMAN pieces into the directory. The upload returns a task ID; read its log with SELECT text FROM TABLE(rdsadmin.rds_file_util.read_text_file('BDUMP','dbtask-1786352112417-512.log')). Remember that this local copy uses instance storage until you remove it.



Step 10: Azure and Google Cloud

Oracle's backup modules target OCI Object Storage and Amazon S3. For a self-managed database on an Azure or Google Cloud VM there are three working patterns:


  • Disk first, then copy: back up to a fast local or NFS file system (for example Azure Files or Filestore), then copy the backup pieces to Blob Storage or Cloud Storage with azcopy or gcloud storage, and protect them with an immutability policy. Simple and fast to restore, at the cost of a staging area.

  • An S3-compatible endpoint: where the storage service offers one, the S3 module can be pointed at it with -awsEndPoint. Test this thoroughly before relying on it, because it is outside what Oracle certifies.

  • A third-party media manager that supports all three clouds, if the estate already has one.


For Oracle Database@Azure and Oracle Database@Google Cloud you do not need any of this: the Exadata and Autonomous services underneath back up to OCI Object Storage or to the Autonomous Recovery Service, configured from the OCI console.



Step 11: Validate and Test the Restore

A backup is proven only by a restore. RESTORE ... VALIDATE reads every piece RMAN would need from the bucket and checks it, without writing any file. Run it monthly, and run a real restore to a different host every quarter.


Shell

rman target / <<'EOF'

CROSSCHECK BACKUP;

DELETE NOPROMPT EXPIRED BACKUP;

REPORT NEED BACKUP;

RESTORE DATABASE VALIDATE;

RESTORE ARCHIVELOG FROM TIME 'SYSDATE-1' VALIDATE;

EOF

Expected output

crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=PROD_3k2v8q1a_1_1 RECID=5102 STAMP=1189306544
...
Crosschecked 214 objects

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 35 days
Report of files whose recovery needs more than 35 days of archived logs
File Days  Name
---- ----- -----------------------------------------------------

Starting restore at 13-AUG-26
channel ORA_SBT_TAPE_1: starting validation of datafile backup set
channel ORA_SBT_TAPE_1: piece handle=PROD_3k2v8q1a_1_1 tag=L0_WEEKLY
channel ORA_SBT_TAPE_1: validation complete, elapsed time: 00:38:51
Finished restore at 13-AUG-26

What to expect: Every piece found AVAILABLE, no file listed under REPORT NEED BACKUP, and the validation finishing without errors. The elapsed time is your best estimate of restore time from the bucket: compare it with the recovery time objective. If it is too slow, add channels (PARALLELISM) or keep the most recent level 0 on local disk as well.



The Four Settings That Make It a Backup

  • Encryption on, with the key material backed up somewhere the database backup cannot reach.

  • Retention as a recovery window, with DELETE OBSOLETE scheduled, so RMAN and the bucket agree.

  • A locked retention rule (or S3 Object Lock, or a Blob immutability policy) matching the window, so nobody can delete the backups early.

  • A scheduled restore test to a different host, using only what is in the bucket, with the elapsed time recorded.



Summary

On OCI, create a bucket with a retention rule, give a dedicated user an API key, install the Cloud Backup Module with oci_install.jar and point an SBT channel at libopc.so. On AWS the same steps use osbws_install.jar and libosbws.so, and S3 Object Lock protects the bucket. RDS uses its own snapshots and rdsadmin procedures, and Azure and Google Cloud VMs back up to disk and copy to immutable storage, while the Oracle Database@ services back up through OCI. Whatever the platform, encrypt, express retention as a recovery window, lock the bucket, and prove every backup with a restore.

Recent Posts

See All

Comments


bottom of page