We were using the Oracle Database Backup on a managed disk directly connected to the Virtual Machine (VM), then copying over to other storage, but to keep a backup for even a month is expensive on a managed disk.

Azure Blob Storage is inexpensive and provides considerable speed for Oracle Database Backups and Recovery.  

This blog shows you how to use BlobFuse, mount a Blob storage container on a Linux machine, and use it for Recovery Manager (RMAN) backups.

 

What is 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.

To get the RMAN backup on the Azure Blob storage container we need three things:

  1. Create a Blob storage account in the Microsoft Azure Portal
  2. Install BlobFuse on a Linux Machine
  3. Mount Microsoft Azure Blob Storage as a Filesystem

 

1. Create a Blob storage account in the Microsoft Azure Portal

Go to Azure Portal –> Storage Account –> click on “Add” to create a Storage Account. 

Here is the example of my storage account where I choose hot Blob, standard performance, and Locally-Redundant Storage (LRS) redundancy. You can choose as per the requirement.

rman

 

2. Install BlobFuse on a Linux Machine

Go to the Azure VM where you installed Oracle Database add the RPM repository of BlobFuse specific to your OS distribution and install BlobFuse.

  [oracle@dev-ordb-01 ~]$ sudo rpm -Uvh https://packages.microsoft.com/rhel/7.8/prod/blobfuse-1.4.1-RHEL-7.8-x86_64.rpm
Retrieving https://packages.microsoft.com/rhel/7.8/prod/blobfuse-1.4.1-RHEL-7.8-x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:blobfuse-1.4.1-1.el7             ################################# [ 50%]
Cleaning up / removing...
   2:blobfuse-1.3.6-1.el7             ################################# [100%]
[oracle@atz-retail-pos-dev-ordb-01 ~]$

[oracle@dev-ordb-01 ~]$ sudo yum install blobfuse

 

3. Prepare for Mounting 

Create this temporary directory and ensure that the Oracle account has access to it. This temporary path is required for BlobFuse to open file contents.

  [oracle@dev-ordb-01 ~]$ sudo mkdir /mnt/resource/blobfusetmp -p

  [oracle@dev-ordb-01 ~]$ sudo chown oracle -R /mnt/resource/blobfusetmp

Create a BlobFuse configuration file with the below content:

[oracle@dev-ordb-01 mnt]# cat /home/oracle/fuse_connection.cfg
accountName manojdevstg
accountKey O8HgfgFGDumn2sGRT000dkfdkfdlfdhfn7HqmCnh2kuFJIEk/JpQdfffvFg
containerName test
[oracle@dev-ordb-01 mnt]#

The account name is the Azure storage account name which I created in Step 1.

We can find the account key by going to the Azure portal storage account –> click the access key like below:

rman2

The container name is the container we created in the Azure Storage Account like I created a test container.

rman3

Save the File and Restrict Access.

    [oracle@dev-ordb-01 ~]# chmod 600 fuse_connection.cfg

Create a Directory that will be used for mounting the Azure Blob Storage Container.

    mkdir ~/mycontainer

Now mount the Blob Storage Container as I specified in the configuration file using the below command.

      [oracle@dev-ordb-01 blobfusetmp]$ sudo blobfuse ~/mycontainer
      --tmp-path=/mnt/resource/blobfusetmp 
      --config-file=/home/oracle/fuse_connection.cfg -o attr_timeout=240 -o
      entry_timeout=240 -o negative_timeout=120 -o allow_other

 

Now you can see the BlobFuse Mount Point.

      [root@dev-ordb-01 blobfusetmp]# df -h | grep blob
      
      blobfuse         74G   21G 
       5029% /home/oracle/mycontainer

 

Now we are ready for RMAN Backup to Blob Storage Container.

Connect to Oracle Database and Run the backup:

      rman target /
         RMAN  configure channel device type disk format;
         '/home/oracle/mycontainer/test/ora_df%t_s%s_s%p';

After the backup is complete, we can see the backup file in Azure Portal Storage Account Container Test:

rman4