Backup Oracle Database to Oracle Cloud Infrastructure Object Storage

Introduction:

Oracle databases benefit from continuous backup, providing organizations with crucial protection during disasters. Implementing a backup strategy is complex and expensive, contingent on Recovery Time Objective (RTO) and Recovery Point Objective (RPO). Data or time loss poses a significant threat, particularly to large organizations. Formulating a robust, resilient, and cost-effective backup and recovery plan presents a challenging problem. Oracle overcomes this by leveraging the strength of Oracle Cloud Infrastructure Object Storage, using the Oracle Cloud Backup Module. This blog offers a detailed, step-by-step process explaining data storage on Oracle Cloud Infrastructure.

 

Installing the Oracle Database Cloud Backup Module for OCI

Basic requirements before installing the module

  1. Support Oracle Database Version and Operating System
  2. Access to Oracle Technology Network (OTN)
  3. OCI Cloud Account and access to Object Storage
  4. Access keys and Tenancy OCID and User OCID (Oracle Cloud Identifier)
  5. Java 1.7 or later

 

Install the Backup Module

Create an object storage bucket on OCI

To install the module download the module from OTN and unzip on your DB Server

Run the command to install the module 

java -jar oci_install.jar
-host https://objectstorage.us-phoenix-1.oraclecloud.com
-pvtKeyFile oci_private_key -pubFingerPrint oci_public_fingerprint
-uOCID user_ocid -tOCID tenancy_ocid
-walletDir /wallet_directory -libDir /library_directory
-bucket oci_backup_bucket
-configFile

 

The following table lists the required and optional parameters.

Parameter Description Required ?
host Oracle Object Storage Endpoint that you can gather from your cloud account Yes
pvtKeyFile Key file that allows you to authenticate API requests on OCI Yes
pubFingerPrint A paired fingerprint generated when the public is associated with your OCI cloud account Yes
uOCID The user OCID that can be taken from the Oracle Cloud Infrastructure tenancy Yes
tOCID The tenancy OCID that can be taken from the Oracle Cloud Infrastructure tenancy Yes
walletDir The directory where Oracle Wallet Credentials are stored. If a directory does not exist then one is created Yes
libDir The directory where System Backup  are stored. If a directory does not exist then one is prompted to create a directory and will be asked to run the installer again. Creates a file libopc.so for Linux and oraopc.dll for Windows Yes
bucket Name of the bucket on OCI Object Storage where the backups would be stored No
configFile The directory where OCI Object Storage configuration files are stored. Generally in opc_SID.ora format No

 

Below url provide the details of the parameters:

https://docs.oracle.com/en/cloud/paas/db-backup-cloud/csdbb/installing-oracle-database-cloud-backup-module-oci.html#GUID-3A209515-DF1B-48DD-9A94-1358FEE9A3DC

Once you run the command, the backup module is installed and configured to push the backups to Object Storage on OCI.

Configure RMAN to use Object Storage as Backup Location

Log into RMAN environment

show all;

Backup the original RMAN configuration to revert back in case of failure

Configure SBT Type backup to point to the new backup location which is Oracle Object Storage in this case

CONFIGURE CHANNEL DEVICE TYPE sbt PARMS=’SBT_LIBRARY=<path_to_lib_dir>/libopc.so, SBT_PARMS=(OPC_PFILE=<path_to_config_dir>/oci_config.ora)’;

Configure compression algorithm to medium which is the recommended level for cloud backups and backups must be in form of backupset, not image copies

CONFIGURE COMPRESSION ALGORITHM ‘MEDIUM’;
CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO COMPRESSED BACKUPSET;

All backups to Oracle Cloud must be encrypted which can either be TDE based encryption or Password based encryption, in case, if TDE is enabled on database run following command

set encryption on;

Else, enable password based encryption in the following way

SET ENCRYPTION ON IDENTIFIED BY ‘your_password’;

Backup the database to Object Storage

Once the encryption is enabled you have completed basic RMAN configuration to backup to Object Storage.

You can test your configuration by issuing a backup command to backup only controlfile and then perform backup of the database,

BACKUP CURRENT CONTROLFILE;
BACKUP DATABASE;

Once the backup is complete, all your backup files will reside in OCI Object Storage Bucket, which can replicated to various OCI regions using replication policies.

Conclusion:

In conclusion, continuous backup for Oracle databases is a vital measure to secure organizations during disasters. Creating a robust and cost-effective backup strategy is essential, and Oracle’s Cloud Infrastructure Object Storage, along with the Cloud Backup Module, offers a practical solution. The blog provides valuable insights into this process.

Recent Posts

Start typing and press Enter to search