Backup Oracle Database to Oracle Cloud Infrastructure Object Storage
Using Oracle Cloud Backup Module
Oracle databases can be preserved with continuous backup. Once the database is backed up then it can be restored either to the same database or to another database. But, it is an activity that enables organizations to secure their databases in any disastrous situations.
It is a difficult task to come up with a backup strategy and it is an expensive endeavor which depends on company’s Recovery Time Objective and Recovery Point Objective. Any loss of data or any loss of time is a loss especially for large organizations. In that case, how does company strategize the backup and recovery is a difficult problem to solve. The strategy needs to be robust, resilient and cost-effective!
Oracle utilizes the robustness and resilience of Oracle Cloud Infrastructure Object Storage which is very cost effective and can be achieved using a simple module called Oracle Cloud Backup Module. So how do we store data on Oracle Cloud Infrastructure? That’s what this blog describes in a very detailed step-by-step process.
Step 1 : Installing the Oracle Database Cloud Backup Module for OCI
Basic requirements before installing the module
- Support Oracle Database Version and Operating System
- Access to Oracle Technology Network (OTN)
- OCI Cloud Account and access to Object Storage
- Access keys and Tenancy OCID and User OCID (Oracle Cloud Identifier)
- Java 1.7 or later
- For SE edition Database please read the following doc DOC ID 1640149.1
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
Other parameter and detail of the parameters can be found here.
Once you run the command, 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;
Preserve 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.
These are series of blogs that I’ll be publishing that’ll cover restoration process and backups on DBCS and many more… Stay tuned!
About Author:
Phani Turlapati is a Cloud Engineer at Oracle Inc. He’s been with Oracle for over 3 years. He started out at Solution engineering hub at Oracle focusing on various design solutions to help customer to value-add to their businesses. He’s a part of Database Team focusing on all things database. Prior to Oracle he had worked as Software Engineer developing application on Java Platform.
The blog is my view and is no way related to Oracle
Feel free to comment on the above post. Your feedback is valuable!