hamburger icon close icon
Azure Backup

Oracle RMAN Backup on Azure Blob

Oracle remains a popular database thanks to its high standards of data integrity, performance, and portability. Oracle is fully supported in Azure through native IaaS solutions or through integration with OCI. But what can organizations do to define a robust Azure backup and data protection strategy for their Oracle workloads?

One tool developed by Oracle for data protection and backup is Recovery Manager, or RMAN. This popular backup tool is widely used by Oracle administrators, and now it can benefit Azure-based Oracle workloads as well. In this blog we’ll show you how to use Azure Blob storage as a target for Oracle RMAN backup using the opensource blobfuse virtual file system driver.

Data Protection for Oracle in Azure

Organizations deploying databases in Azure can choose to go with either an IaaS or DBaaS migration approach. In the case of Oracle, DBaaS is provided through integration with OCI, where Oracle applications are deployed in Azure and connected to databases in OCI via ExpressRoute and Oracle FastConnect.

Other Oracle users opt for the IaaS deployment model, which gives them full control of the deployment stack starting from the operating system all the way to the application stack. This approach depends on Oracle images from Marketplace, Azure VM SKUs fine-tuned for database workloads, and storage on Azure managed disks. Customers can also make use of license mobility that will help them reuse their Oracle licenses in the cloud. The IaaS deployment approach provides flexibility of using familiar tools for management irrespective of where the workload is deployed, and it also makes it possible to add managed storage capabilities via NetApp Cloud Volumes ONTAP for Azure.

As with any mission-critical enterprise deployment, Oracle databases need to be protected. When it comes to data protection for Oracle in the IaaS deployment model, administrators can leverage RMAN backup solutions or use Azure’s native backup solutions.

What is Oracle RMAN?

Oracle RMAN (Recovery Manager) is the native backup solution available in Oracle databases starting from version 8. It was devised to address the backup/recovery and disaster recovery requirements of Oracle databases. The service is part of the Oracle installation and is the recommended tool for backup by Oracle as it offers a robust and simplified administrative approach.

RMAN backups will have a default target location configured to a location in the local disk. It is now possible to use Azure Blob storage as the target with the help of an open-source tool called blobfuse. Blobfuse is a virtual file system driver that can be used to access a block blob from your Linux machine by mounting it to a virtual directory. In the backend, blobfuse leverages the linfuse open-source library and establishes communication with the Linux FUSE kernel module, allowing read/write operations to be carried out by Azure Blob REST APIs.

RMAN can be reconfigured to use the directory mounted using blobfuse as the target for storing backups. As a result, the backup files can be directly stored in Azure Blob storage in a seamless manner. Blobfuse allows multiple nodes to mount the same storage container in read-only mode. This is helpful in a number of use cases, including quickly restoring backup data in a different machine.

Blobfuse: Mounting Azure Storage as a File System

To mount an Azure Blob storage backup target in a virtual directory for Oracle RMAN backup, follow these steps:

1. SSH to the Oracle VM and add the RPM repository of blobfuse specific to your OS distribution. For this demo we will be using a RHEL 6 distribution.

sudo rpm -Uvh https://packages.microsoft.com/config/rhel/6/packages-microsoft-prod.rpm

SSH to the Oracle VM and add the RPM repository of blobfuse specific to your OS distribution

You can find the repositories for other Linux distributions here.

  1. Install blobfuse using the following command:
 sudo yum install blobfuse

Install blobfuse using the following command

  1. A temporary path is required for blobfuse to open or cache file contents. Create this temporary path and ensure that your user account has access to it using the following commands:
sudo mkdir /mnt/resource/bftmpfolder -p
sudo chown <username> /mnt/resource/bftmpfolder

Replace <username> with your user account.

Replace <username> with your user account.

  1. Use a text editor to create the blobfuse config file
vi fuse_connection.cfg

Add the using the following content to the file.

accountName <storageaccountname>
accountKey <storageaccesskey>
containerName <containername>

Replace the bracketed values with your respective storage name, access key, and the storage container to be used for the backup.

Replace the bracketed values with your respective storage name, access key, and the storage container to be used for the backup

Add the contents and save the file.

  1. Restrict access to the config file using the following command:
chmod 600 fuse_connection.cfg

chmod 600 fuse_connection.cfg

  1. Now create a directory that will be used for mounting Azure Blob storage container with the following code:
 mkdir ~/oracletest

mkdir ~/oracletest

  1. Run the following command to mount the blob container specified in the configuration file to the folder created in the previous step:
 sudo blobfuse ~/oracletest --tmp-
path=/mnt/resource/bftmpfolder --config-
file=/home/azureuser/fuse_connection.cfg -o
attr_timeout=240 -o entry_timeout=240 -o
negative_timeout=120 -o allow_other

Run the following command to mount the blob container specified in the configuration file to the folder created in the previous step

RMAN Backup to Azure Storage

Now that blobfuse is installed and configured, follow the steps below to bring your RMAN backup over to Azure Storage. 

  1. Connect using the Oracle super user and check that the listener is running using the following commands:
sudo su - oracle
lsnrctl start

Connect using the Oracle super user and check that the listener is running using the following commands

  1. Run the following commands to confirm that the database is in archive log mode:
$ sqlplus / as sysdba
SQL> SELECT log_mode FROM v$database;

Run the following commands to confirm that the database is in archive log mode

  1. Run the following Oracle RMAN commands to reconfigure the backup location and point it to the file share we created for blobfuse:
rman target /
RMAN> configure channel device type disk format
'/home/azureuser/oracletest/ora_df%t_s%s_s%p';

Note: The format specifier in the command will get replaced as follows: %t is replaced by timestamp, %s with the backup set number, and %p with backup piece number. You can read more about this process here.

Run the following Oracle RMAN commands to reconfigure the backup location

  1. Run the following command to initialize the RMAN backup:
 RMAN>backup database plus archivelog;

Run the following command to initialize the RMAN backup

You can see that the backup is being stored to the folder mounted using blobfuse.

You can see that the backup is being stored to the folder mounted using blobfuse.

  1. Browse to the container in the storage account from the Azure portal and you can see that the backup files are present in the container:

Oracle Backup

Gain Even More Protection for Your Azure Database

You’ve just seen how you can protect your Oracle database workload in Azure using RMAN backup and blobfuse. While this is a great resource for backing up your Oracle database in the Azure ecosystem, you can gain more from your Oracle deployments and ensure enhanced data protection of your workloads using NetApp Cloud Volumes ONTAP for Azure.

Based on NetApp’s trusted ONTAP data management platform, Cloud Volumes ONTAP delivers enterprise class storage services for your cloud native and hybrid deployments. When used as a managed storage solution in your IaaS deployment, Cloud Volumes ONTAP delivers enhanced storage economy, agility, and data protection capabilities that go beyond those available natively on Azure even with the use of open-source tools like blobfuse.

By adding Cloud Volumes ONTAP to your Oracle deployment architecture in Azure, you can augment the data recovery capabilities by leveraging proprietary NetApp ONTAP platform features. Cloud Volumes ONTAP can be accessed by Oracle and application VMs over both SMB/ CIFS and the NFS protocols or attached as iSCSI disks. While deployed in a highly available configuration, Cloud Volumes ONTAP helps to ensure RPO=0 and RTO < 60 seconds.

Backup is also less expensive on Azure with Cloud Volumes ONTAP thanks to space-efficiency features like deduplication, compression, and automatic data tiering between Azure disk and Blob storage, all of which combine to reduce the cloud storage footprints and bills significantly. NetApp Snapshot™ technology can also be used to take point-in-time data efficient snapshots of Cloud Volumes ONTAP volumes where your Oracle database is hosted. These application-consistent snapshots ensure that workable copies of the data are stored in the backup. The feature is already built-in to Cloud Volumes ONTAP and can be incorporated into your organization BC/DR strategy with minimal overhead.

In data migration scenarios from on-premises to cloud, SnapMirror® data replication technology can be a quick alternative to time consuming backup and restore processes, speeding up recovery operations, where time is critical. FlexClone® data cloning technology is another useful feature of Cloud Volumes ONTAP that helps you to create multiple space-efficient but writable clones of your Oracle database volumes. These clones can then be used to spin up multiple test and development environments with no impact on production workload, at minimal storage overheads and costs, which greatly enhances the development process and cuts down time to market.

Oracle workloads in Azure can be protected through Oracle RMAN backup, Azure backup or by using the advanced data management features offered by Cloud Volumes ONTAP. At the enterprise level, it’s clear which choice is best.

New call-to-action
Yifat Perry, Technical Content Manager

Technical Content Manager

-