Three Ways to backup your Oracle Cloud Databases to Object Storage

Introduction

Oracle Cloud provides you the option to enable automatic backups with the click of a button. In case you have different backup requirements, you still have the flexibility to create your manual backup configurations and create your backups via command-line tools or directly using RMAN. This applies to VM DB Systems, Exadata Cloud Service, and Exadata Cloud at Customer.

This blog post will highlight the main differences between the different backup options and the cost associated with them when using Oracle Cloud Object Storage as a backup destination. Object Storage provides built-in triple mirroring and durability of 99.999999999% (eleven nine’s).

Hybrid-Cloud and Multicloud

Oracle Database backup into Oracle Cloud Object Storage is not limited to Oracle databases in Oracle Cloud but can also be implemented via RMAN for on-premises Oracle databases in hybrid-cloud or Oracle databases running on non-Oracle clouds in multicloud environments.

Private and dedicated network connectivity can be provided via FastConnect, Azure Interconnect, or 3rd party network connectivity providers. In Multicloud environments, additional outbound traffic costs are likely to occur, depending on your cloud provider, region, and amount of data to transfer. Many Cloud providers, including Oracle, have already joined the Bandwidth Alliance to reduce or eliminate network egress fees.

The Environment

  • VM DB Systems and Exadata Cloud Services in Oracle Cloud.
  • Oracle Cloud Object Storage.

1. Backups via Cloud Tooling (Automatic and Manual)

Cloud Tolling (Web UI, OCI CLI, JDKs, Rest APIs) provides automatic and manual backups.

Automatic Backups can be enabled with a few clicks. From the database details page, click on “Enable Automatic Backups”.

Make sure you meet the prerequisites as described in the documentation.

Automatic backups have the following characteristics:

  • Destination: Standard Object Storage bucket managed by Oracle.
  • Scheduling: Fixed two hours windows, e.g. from 4:00 am to 06:00 am. Can be changed afterward.
    • Archivelog backups: Hourly for DBCS VMs, every 30 minutes for ExaCS.
  • Retention: 7, 15, 30, 45, or 60 days. Can be changed afterward.
  • Cost: Standard Object Storage space.
  • In-Place Restore: Yes.
  • Create Database from Backup: Yes.
  • Replication across ADs or Regions: No.
  • Restore across ADs or Regions: No. Possible manually.
  • Backup to Archive Storage: No.
  • Backup of Standby Database: No.

Additionally, you can create standalone backups on-demand, which are independent full database backups usually used for a long-term backup strategy (keep forever).

The backup will be listed as “Full Backup. Initiated by User”

These backups will be retained even after terminating your database and be visible in the “Standalone Backups” section. You can use them to create a new database.

Manual backups have the following characteristics:

  • Destination: Standard Object Storage bucket managed by Oracle.
  • Scheduling: on-demand.
  • Retention: forever (until deleted explicitly).
  • Cost: Standard Object Storage space.
  • In-Place Restore: No.
  • Create Database from Backup: Yes.
  • Replication across ADs or Regions: No.
  • Restore across ADs or Regions: No. Possible manually.
  • Backup to Archive Storage: No.
  • Backup of Standby Database: No.

2. Command Line Tools (dbcli / bkup_api)

If you need more flexibility and customization, you could use the command line tools provided on VM DB Systems and ExaCS to create your own backup strategy:

  • dbcli is a command-line tool available on VM DB Systems.
  • bkup_api.is a backup utility available on ExaCS.
#dbcli
dbcli create-backup -in <db_name> -i <db_id> [-bt {Regular-L0|Regular-L1|Longterm|ArchiveLog}] [-c {Database|TdeWallet}] [-k <n>] [-t <tag>] [-h] [-j]

#bkup_api
/var/opt/oracle/bkup_api/bkup_api bkup_start --dbname=<database_name>

Backups via dbcli or bkup_api have the following characteristics:

  • Destination: Standard Object Storage bucket managed by the customer.
  • Scheduling: Can be defined by the customer.
    • Archivelog backups: Hourly for DBCS VMs, every 30 minutes for ExaCS.
  • Retention: Can be defined by the customer.
  • Cost: Standard Object Storage space and number of requests.
  • In-Place Restore: Yes.
  • Create Database from Backup: Yes.
  • Replication across ADs or Regions: Yes.
  • Restore across ADs or Regions: Yes.
  • Backup to Archive Storage: No.
  • Backup of Standby Database: No.

3. Manual RMAN Backups

For full flexibility, you are always able to backup your database directly via RMAN as you would do on-premises.

To store the backup on Object Storage, you need to use the Oracle Database Cloud Backup Module, which is already available on:

  • VM DB Systems: /opt/oracle/oak/pkgrepos/oss/odbcs/
  • ExaCS: /var/opt/oracle/ocde/assistants/bkup/

It is advisable to download the current version (opc_installer.zip file) and install it into a user-defined directory not overriding the existent libopc.so used for automatic backups.

Create an Object Storage bucket, install and configure the Backup Module:

mkdir /home/oracle/bckmodul  #move the opc_installer.zip to this directory
mkdir /home/oracle/bckmodul/lib
cd /home/oracle/bckmodul
unzip opc_installer.zip

#replace the values according to your environment
java -jar /home/oracle/bckmodul/opc_installer/opc_installer/opc_install.jar -opcId 'sinan.petrus.toma@oracle.com' -opcPass 'N8Pr6cf]<kL(+UU4<mTm' -container backup_bucket -walletDir /home/oracle/bckmodul/hsbtwallet/ -libDir /home/oracle/bckmodul/lib/ -configfile /home/oracle/bckmodul/config -host https://swiftobjectstorage.eu-frankfurt-1.oraclecloud.com/v1/oci_core_emea

Oracle Database Cloud Backup Module Install Tool, build 12.2.0.1.0DBBKPCSBP_2018-06-12
Oracle Database Cloud Backup Module credentials are valid.
Backups would be sent to container backup_bucket.
Oracle Database Cloud Backup Module wallet created in directory /home/oracle/bckmodul/hsbtwallet.
Oracle Database Cloud Backup Module initialization file /home/oracle/bckmodul/config created.
Downloading Oracle Database Cloud Backup Module Software Library from file opc_linux64.zip.
Download complete.

cat /home/oracle/bckmodul/config
OPC_HOST=https://swiftobjectstorage.eu-frankfurt-1.oraclecloud.com/v1/oci_core_emea
OPC_WALLET='LOCATION=file:/home/oracle/bckmodul/hsbtwallet CREDENTIAL_ALIAS=alias_opc
OPC_CONTAINER=backup_bucket

Now you can use Object Storage as a backup destination in your RMAN backups:

rman target /
RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/bckmodul/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/home/oracle/bckmodul/config)';
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO SBT_TAPE;
RMAN> backup database;

Backups directly via RMAN have the following characteristics:

  • Destination: Object Storage bucket managed by the customer.
  • Scheduling: Can be defined by the customer.
    • Archivelog backups: Can be defined by the customer.
  • Retention: Can be defined by the customer.
  • Cost: Standard Object Storage space, number of requests, and Backup Module cost.
  • In-Place Restore: Yes.
  • Create Database from Backup: Yes.
  • Replication across ADs or Regions: Yes.
  • Restore across ADs or Regions: Yes.
  • Backup to Archive Storage: Yes. Time To First Byte (TTFB) is up to one hour
  • Backup of Standby Database: Yes.

Oracle Autonomous Database

In Oracle Autonomous Database, automatic backup is always enabled by default, and it cannot be disabled. The cost of Cloud Object Storage for automatic backups is included in the service price.

Additional manual backups can be created via Cloud Tooling on demand. The manual backups will be stored in Standard Object Storage.

The retention time for the automatic and manual backups is 60 days. Backups can only be used to restore or create a new Autonomous Database.

Backup vs. Archiving

If you consider using a manual backup strategy just because you need to keep your data for several years, e.g., for auditing requirements, then think of using Data Pump Export for this purpose. Backups are intended for disaster recovery, not for archiving.

Advantages of Data Pump Export and Import for archiving:

  • Lower cost by storing the dump files on Archive Object Storage.
  • Choose only the data needed to be archived at schema and even at table level, instead of the entire database.
  • Can be imported into different platforms and higher database versions, most probably even decades later without any issue.
  • Is much easier than creating a database from scratch using a backup. No need to install a database software, configure RMAN, restore the parameter file and control files, and “hope” you still have all archive logs in place to recover the database to the point in time needed.

Disadvantages:

  • Data Pump Import might take longer than an RMAN restore for a large amount of data. But in the case of archiving for several years, you very probably would know when you need access to that data ahead of time and you can start the import process in a timely manner.

Considerations

For manual backups, make sure to use a separate Object Storage bucket for each database. DO NOT mix backups of different databases in the same bucket, leading to conflicts.

Conclusion

Automatic backups provide you an easy way to backup your Oracle Cloud Databases into Oracle Cloud Object Storage. Manual backups via Cloud Tooling offer backups for a long-term retention period. Additionally, you have the flexibility to create manual backups via command-line tools or directly via RMAN in case you have different backup requirements. The features and cost depend on the backup method you choose.

Features overview:

Cost overview:

Further Reading

Would you like to get notified when the next post is published?