Oracle Recovery Manager (RMAN) is a powerful tool for database backup and recovery. When integrated with Oracle Cloud Infrastructure (OCI) Object Storage, RMAN provides a seamless way to store and restore backups. This blog will guide you through the process of configuring Oracle Cloud Storage with RMAN and restoring a database from Oracle Cloud Infrastructure (OCI).
Step 1: Download and Install the Oracle Database Cloud Backup Module
The Oracle Database Cloud Backup Module allows RMAN to interact with OCI Object Storage. Follow these steps:
Download the Oracle Database Cloud Backup Module for OCI from Oracle Technology Network (OTN):
https://www.oracle.com/database/technologies/oracle-cloud-backup-downloads.html
Click ‘All Supported Platforms’ and accept the license agreement. Then, download the ZIP file that contains the installer (opc_installer.zip
) to your system. Provide your OTN username and password when prompted.
1.1 Unzip the Cloud Backup Installer
bash
unzip opc_installer.zip -d /path/to/dir
1.2 Navigate to the Installer Directory
cd /path/to/dir/opc_installer/oci_installer/
1.3 How to Obtain These on OCI Console
Region Identifier (<region>)
- Log in to the OCI Console.
- Click on your Profile (top-right corner) > Tenancy: [Your Tenancy Name].
- The Region name is displayed. Example: us-ashburn-1.
- Use this in -host https://objectstorage.<region>.oraclecloud.com.
OCI Username (<your-oci-username>)
- Your OCI username is typically in the format:
tenancy_name/user_name - Find this under Profile > User Settings in the OCI Console.
Authentication Token (<your-auth-token>)
- Go to Profile > User Settings.
- Scroll down to Auth Tokens.
- Click “Generate Token,” copy it, and use it in the -opcPass option.
Object Storage Bucket Name (<bucket_name>)
- Navigate to Storage > Object Storage in the OCI Console.
- Click on the Bucket Name where you want to store backups.
- Use this bucket name in -container.
1.4 Run the Installer
Execute the following command to configure the backup module:
java -jar oci_install.jar \
-host https://objectstorage.us-ashburn-1.oraclecloud.com \
-libdir /path/to/lib_dir \
-walletDir /path/to/opc_wallet_dir \
-tOCID <TENANCY_OCID> \
-uOCID <USER_OCID> \
-bucket <BUCKET_OCID> \
-pvtKeyFile /FRA/cloud/<PRIVATE_KEY_FILE> \
-pubFingerPrint <PUBLIC_KEY_FINGERPRINT>
NOTE: Replace <TENANCY_OCID>, <USER_OCID>, <BUCKET_OCID>, <PRIVATE_KEY_FILE>, and <PUBLIC_KEY_FINGERPRINT> with your actual OCI values.
Step 2: Configure the RMAN Cloud Backup Settings
2.1 Edit the RMAN Configuration File
Modify the file opc<DBNAME>.ora to specify the Oracle Cloud wallet location.
bash
vi /u01/app/oracle/product/19.3.0/dbs/opc<DBNAME>.ora
Replace OPC_WALLET value with the actual bucket name.
Save and exit:
:wq!
Step 3: Restore the Database from OCI Backup
3.1 Retrieve the DBID
NOTE: if you are restoring the database to a different server, then get the dbid from the old server, and if you are restoring from the same server, then get dbid from the RMAN banner:
From the old server:
Select DBID from v$database;
From the current server:
Connect to RMAN and get the DBID from the previous database:
ORACLE_SID=<dbname>
rman target /
Recovery Manager: Release 12.1.0.1.0 - Production on Tue Apr 1 15:54:46 2025
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (DBID=2714290597)
3.2 Set DBID for Restore
set DBID 271290597;
Note: Replace 2714290597 with the actual DBID.
3.3 Prep Database and Backup for Restore
Run the following command. If the server parameter file is not available, RMAN attempts to start the instance with a dummy server parameter file. The ORA-01078 and LRM-00109 errors are normal and can be ignored.
STARTUP FORCE NOMOUNT;
Decrypt backup:
SET DECRYPTION IDENTIFIED BY password;
3.4 Restore the Database
Restore the server parameter file from the auto-backup
The SBT_LIBRARY is the same library specified with the -libDir parameter when the Backup Module was installed, for example, /home/oracle/lib/.
The OPC_PFILE is the same file specified with the -configfile parameter when the Backup Module was installed, for example, /home/oracle/config.
set control file auto backup format for device type sbt to '%F';
run {
allocate channel c1 device type sbt PARMS 'SBT_LIBRARY=/home/oracle/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/home/oracle/config)';
restore spfile from auto backup;
}
Restart the instance with the restored server parameter file.
STARTUP FORCE NOMOUNT;
Restore the control file from the RMAN auto backup and mount the database.
set controlfile autobackup format for device type sbt to '%F';
run {
allocate channel c1 device type sbt PARMS 'SBT_LIBRARY=/home/oracle/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/home/oracle/config)';
restore controlfile from autobackup;
alter database mount;
}
Restore and recover the database.
RESTORE DATABASE;
RECOVER DATABASE;
Open the database with resetlogs.
ALTER DATABASE OPEN RESETLOGS;
Conclusion
Restoring an Oracle database from Oracle Cloud Infrastructure (OCI) using RMAN is a streamlined and efficient process when correctly configured. By leveraging the Oracle Database Cloud Backup Module and integrating RMAN with OCI Object Storage, administrators can achieve robust disaster recovery solutions with cloud resilience and scalability.
The procedure ensures that your critical data can be reliably restored with minimal manual intervention, whether you’re dealing with disaster recovery, migration to new hardware, or simply testing your restore procedures.
Reap maximum value from your Oracle database with XTIVIA remote DBA services.
Contact us for more information.