Skip to main content
  1. Blog/

Veeam Oracle RMAN Plugin

·3099 words·15 mins·
Author
Marco Escobar
Data protection, Kubernetes, cybersecurity and AI. Hands-on guides from the trenches: Veeam, Kasten, VMware, Oracle, cloud, and whatever I’m breaking in the homelab this week.
Table of Contents
Veeam Oracle RMAN Plugin - veop

This time we’ll walk through the installation, configuration and backup (with scripts, and of course a few tips) to get Veeam Oracle RMAN Plugin fully up and running. I’m often asked about this solution, since it’s a simple, flexible and reliable way to store RMAN (Recovery Manager) backups. This post focuses only on Oracle RAC on Linux with ASM, plus database recovery with Veeam Explorer for Oracle. It’s a 4-in-1 post.

Introduction
#

First of all, there’s one important thing to understand: Veeam Oracle RMAN Plugin is a tool that works together with Recovery Manager (RMAN), Oracle’s native backup solution, to run vendor-supported backups.

With that said, let’s briefly explain what Veeam Oracle RMAN Plugin is and what it does, because as we know, the backup itself is performed by RMAN working together with the Plugin.

Of course, there are other ways to back up Oracle databases with Veeam, for example with Veeam Agent for Linux or the native Oracle integration for virtualized environments. We’ll cover those in other posts.

What is Veeam Oracle RMAN Plugin?
#

This Plugin is an Oracle-certified Veeam solution (Certification Link) for running RMAN backups and storing them in the Veeam Backup & Replication repository. That way you can store backups of your Oracle databases, whether they run in a cluster (Oracle RAC) or standalone using ASM, and of course recover them through Veeam Explorer for Oracle RMAN.

Technically, what Veeam Oracle RMAN Plugin does is act as an SBT library that you configure with RMAN, so RMAN can use the library to reach the Veeam VBR repositories and store the backups under whatever retention policy you use with RMAN.

Installation
#

Before installing anything, you need to meet the system requirements and supported versions for Veeam Oracle RMAN Plugin, which you can find here:

https://helpcenter.veeam.com/docs/backup/plugins/system_requirements.html?ver=100

The Oracle RAC I have set up in my lab consists of 2 nodes with the following details:

ComponentValue
Operating SystemOracle Linux 7.8
CPU8 vCPU
RAM16 GB
OS Disk50 GB
Oracle iSCSI Disks8 x 20 GB (Shared)
Oracle Version19.3.0.0.0
Oracle Grid Version19.0.0.0.0
ASMYes
DatabasesBRAZIL, CHILE, RAC19C

Table: Oracle RAC Lab 24xSiempre Details

A view of the RAC configuration using the command:

Veeam Oracle RMAN Plugin - screenshot 1

Once you’re completely sure you have the supported versions, download or mount the Veeam Backup & Replication ISO to copy the Veeam Oracle RMAN Plugin installation package:

Veeam Oracle RMAN Plugin - screenshot 2

In my case, as of the date of this post, the latest version of Veeam Oracle RMAN Plugin is:

VeeamPluginforOracleRMAN-10.0.1.4854-1.x86_64.rpm

We’ll use the 64-bit RPM package and install it on every Oracle RAC node, which is the recommended approach, because RMAN can choose which node to run the backup on through a feature called RMAN Node Affinity Awareness.

Copy the file to the nodes however you like. In my case I’ll use WinSCP:

Veeam Oracle RMAN Plugin - screenshot 3

As you can see in the image above, I copied the RPM as the root user to both RAC nodes (20.20.20.91 and 20.20.20.92).

A very important, key point when installing Veeam Oracle RMAN Plugin: install it with the “root” user and then configure it with the Oracle user, which is usually “oracle”. Treat this as a general rule, because if you configure it as “root” you won’t have access to Oracle’s environment variables and will run into errors.

Now let’s install the plugin on both nodes with the following command:

Linux
rpm -ivh VeeamPluginforOracleRMAN-10.0.1.4854-1.x86_64.rpm
Solaris SPARC
pkgadd -d /VeeamPluginforOracleRMAN-10.0.1.4854-1.SPARC.pkg

Since my Oracle RAC runs on Oracle Linux, I’ll use the Linux command. If your Oracle RAC runs on SPARC, use the command for that operating system. Running it on each node gives you this result:

Node 1:
[root@rac19cn1 ~]# rpm -ivh VeeamPluginforOracleRMAN-10.0.1.4854-1.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:VeeamPluginforOracleRMAN-10.0.1.4################################# [100%]
Run "OracleRMANConfigTool --wizard" to configure the Veeam Plug-in for Oracle RMAN
[root@rac19cn1 ~]#

Node 2:

[root@rac19cn2 ~]# rpm -ivh VeeamPluginforOracleRMAN-10.0.1.4854-1.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:VeeamPluginforOracleRMAN-10.0.1.4################################# [100%]
Run "OracleRMANConfigTool --wizard" to configure the Veeam Plug-in for Oracle RMAN
[root@rac19cn2 ~]#

And as I explained earlier, we’ll run the configuration with the Oracle user, which in this case is “oracle”.

Configuration
#

Now we need to connect via SSH as the “oracle” user (or whichever user owns the Oracle installation) to run the Veeam Plugin for Oracle RMAN configuration. One important detail: the user must have Oracle’s environment variables loaded. If not, load the profile first.

Different DBAs often handle this in different ways: some keep a separate profile file for each Oracle instance, while others set the variables directly in the default user profile. Before you run the configuration, check how the profile is loaded and what it configures.

As the message told us when we installed the plugin, we run the command “OracleRMANConfigTool –wizard” as the oracle user, which produces the following:

[oracle@rac19cn2 ~]$ OracleRMANConfigTool --wizard
Enter backup server name or IP address: veeam24xs.24xsiempre.cl
Enter backup server port [10006]:
Enter username: 24xsiempre\veeam
Enter password for 24xsiempre\veeam:
Veeam repositories:
1. Default Backup Repository
Specify up to 4 Veeam repositories to use as target using whitespace as a separator: 1
Enter the number of data streams (From 1 to 254) to send to each repository concurrently(RMAN DEVICE PARALLELISM value). Channel count per device [1]: 4
Enable Veeam compression? (Y/n): n

Cannot find any Oracle instances.

Please apply the following RMAN settings manually:
CONFIGURE DEFAULT DEVICE TYPE TO SBT_TAPE;
CONFIGURE CHANNEL DEVICE TYPE SBT_TAPE
PARMS 'SBT_LIBRARY=/opt/veeam/VeeamPluginforOracleRMAN/libOracleRMANPlugin.so'
FORMAT '88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec/RMAN_%I_%d_%T_%U.vab';
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1;
CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 4;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F_RMAN_AUTOBACKUP.vab';

Channel definition for RMAN scripts:
ALLOCATE CHANNEL VeeamAgentChannel1 DEVICE TYPE SBT_TAPE
PARMS 'SBT_LIBRARY=/opt/veeam/VeeamPluginforOracleRMAN/libOracleRMANPlugin.so'
FORMAT '88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec/RMAN_%I_%d_%T_%U.vab';

Save configuration?
1. Apply configuration to the Oracle environment
1. Export configuration into a file for manual setup
1. Cancel without saving
Enter:3
*** No Oracle database instances were configured ***

As you can see in the log above, two lines are highlighted, 7 and 12, and you’ll notice the Plugin could not be configured.

Regarding line 7: this only shows the repositories the user has been granted access to. In other words, in the Veeam Backup & Replication repository configuration, under “Access Permissions”, the Default Backup Repository is always allowed by default, so the first time you configure the Plugin you’ll always see this repository, for example:

Veeam Oracle RMAN Plugin - screenshot 4

To grant access to other repositories, I recommend setting the “Default Backup Repository” to “Deny to Everyone”, or only allowing the users who will connect through Veeam Oracle RMAN Plugin. In my case, I’ll block access to the Default Repository and allow access to a Scale-Out Backup Repository (SOBR) to store the backups:

Veeam Oracle RMAN Plugin - screenshot 5

Line 12 is directly tied to the Oracle version running in the RAC. Starting with version 12.2.0.1.171017 GI RU/PSU (patch 26737266) and 12.2.0.1.171017 OCW RU/PSU (patch 26729536), per MOS Note Doc ID 2329359.1, the way instances are registered in the /etc/oratab file changed: that file is no longer updated with the names of the instances running on the Oracle RAC.

When Veeam Oracle RMAN Plugin is configured, it reads /etc/oratab to detect instance names, but if the instances aren’t listed there, unfortunately you won’t be able to configure the plugin.

There are two ways around this. The first is to add the name of each instance running on the Oracle RAC manually (which I don’t like), and the second is to run a script that reads the RAC instances and updates /etc/oratab. That’s the approach we’ll implement here, to automate updating that file.

\\ In Veeam Backup & Replication version 11 this workaround will no longer be needed**

As a recommendation, run it on all Oracle RAC nodes (RMAN Node Affinity Awareness):

original="#\n\n\n\n# This file is used by ORACLE utilities.  It is created by root.sh\n# and updated by either Database Configuration Assistant while creating\n# a database or ASM Configuration Assistant while creating ASM instance.\n\n# A colon, ':', is used as the field terminator.  A new line terminates\n# the entry.  Lines beginning with a pound sign, '#', are comments.\n#\n# Entries are of the form:\n#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:\n#\n# The first and second fields are the system identifier and home\n# directory of the database respectively.  The third field indicates\n# to the dbstart utility that the database should , \"Y\", or should not,\n# \"N\", be brought up at system boot time.\n#\n# Multiple entries with the same $ORACLE_SID are not allowed.\n# \n# \n"
path="/oracle/grid/19.3.0/grid_home/bin/crsctl"
cat /dev/null > /etc/oratab
printf "$original" >> /etc/oratab

for resource in $($path status resource -w "((TYPE = ora.database.type) AND (LAST_SERVER = $(hostname -s)))" | grep ^NAME | sed 's/.*=//'); do
    full_resource=$($path status resource -w "((NAME = $resource) AND (LAST_SERVER = $(hostname -s)))" -f)
    db_name=$(echo "$full_resource" | grep ^DB_UNIQUE_NAME | awk -F= '{ print $2 }')
    ora_home=$(echo "$full_resource" | grep ^ORACLE_HOME= | awk -F= '{ print $2 }')
    instance="1" # Change number based on node and instance number
    oracle="$db_name$instance:$ora_home:N \n"
    printf "$oracle" &>> /etc/oratab
done

# Reconfigure Oracle Plugin
echo=""
no="n" # change to "y" if you need to enable Veeam compression
uno="1" # apply changes
exec >> /home/oracle/veeam.log 2>&1 # log path
OracleRMANConfigTool --wizard <<EOF
$echo
$echo
$echo
$echo
$echo
$echo
$no
$uno
EOF

Copy the file to the nodes as addoratab.sh and make it executable with chmod +x addoratab.sh. One key detail, as shown on line 10: the number must be changed to match the RAC node, since, for example, on node 1 the instance name would be “CHILE1” and on node 2 it would be “CHILE2”. And of course, run the script with sh addoratab.sh or ./addoratab.sh as the “oracle” user. You can check the updated file with cat /etc/oratab.

After setting the Veeam Backup & Replication repository permissions and updating /etc/oratab with the script, we run the plugin wizard again, which shows the following:

[oracle@rac19cn1 ~]$ OracleRMANConfigTool --wizard
Enter backup server name or IP address: veeam24xs.24xsiempre.cl
Enter backup server port [10006]:
Enter username: 24xsiempre\veeam
Enter password for 24xsiempre\veeam:
Veeam repositories:
1. SOBR
Specify up to 4 Veeam repositories to use as target using whitespace as a separator: 1
Enter the number of data streams (From 1 to 254) to send to each repository concurrently(RMAN DEVICE PARALLELISM value). Channel count per device [1]: 4
Enable Veeam compression? (Y/n): n

RMAN settings will be applied automatically to the following databases:
ORACLE_SID=BRAZIL1 ORACLE_HOME=/oracle/db/19.3.0/db_home
ORACLE_SID=CHILE1 ORACLE_HOME=/oracle/db/19.3.0/db_home
ORACLE_SID=RAC19C1 ORACLE_HOME=/oracle/db/19.3.0/db_home

RMAN settings:
CONFIGURE DEFAULT DEVICE TYPE TO SBT_TAPE;
CONFIGURE CHANNEL DEVICE TYPE SBT_TAPE
PARMS 'SBT_LIBRARY=/opt/veeam/VeeamPluginforOracleRMAN/libOracleRMANPlugin.so'
FORMAT '60fc82ee-cedc-458f-beda-346323f93c1e/RMAN_%I_%d_%T_%U.vab';
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1;
CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 4;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F_RMAN_AUTOBACKUP.vab';

Channel definition for RMAN scripts:
ALLOCATE CHANNEL VeeamAgentChannel1 DEVICE TYPE SBT_TAPE
PARMS 'SBT_LIBRARY=/opt/veeam/VeeamPluginforOracleRMAN/libOracleRMANPlugin.so'
FORMAT '60fc82ee-cedc-458f-beda-346323f93c1e/RMAN_%I_%d_%T_%U.vab';

Save configuration?
1. Apply configuration to the Oracle environment
1. Export configuration into a file for manual setup
1. Cancel without saving
Enter: 1

*** Database instance BRAZIL1 is configured ***

*** Database instance CHILE1 is configured ***

*** Database instance RAC19C1 is configured ***
[oracle@rac19cn1 ~]$

As you can see, line 7 now shows only the SOBR assigned for the Oracle backups with Veeam Oracle RMAN Plugin, and lines 13, 14 and 15 show that it recognizes the RAC instances, so RMAN is configured and ready to run the backup.

One more important point: what happens if I add another instance to the Oracle RAC later? It’s simple: if you don’t add the instance to /etc/oratab again, Veeam Oracle RMAN Plugin won’t process it. That’s exactly where a very handy solution (or tip) comes in. The addoratab.sh script is already set up so that, once you schedule it to run daily, it automatically adds the new instance and reconfigures Veeam Oracle RMAN Plugin with no manual intervention.

You just need to schedule it in crontab as the “oracle” user, for example:

[oracle@rac19cn1 ~]$ crontab -e

then add:

0 0 1 ? * * * /home/oracle/addoratab.sh

Close with esc:wq
It runs every day at 1 AM

Backup
#

How you back up the RAC databases is really up to you, or in this case up to the DBAs, since they usually keep their own carefully crafted scripts for backing up databases.

What if you don’t have a script and need to back up your Oracle RAC? Here’s a script to back up every instance running on the Oracle RAC, using the “oracle” user, logging every command, checking for errors if any occur, and of course sending email alerts. (You’ll need to configure mailx.)

#!/bin/bash
 . /home/oracle/.bash_profile                                                # Load Profile and Oracle user environment variables
MAQUINA=`hostname`                                                          # Set machine name variable
LOG=/home/oracle/                                                           # Folder to store logs
HORA=`date +%H%M_%d%m%Y`                                                    # Hour syntax
FECHA=`date +%d%m%Y`                                                        # Date syntax
CORREO=[email protected]
Append=1 # node number where it runs
# Start Script
for ORACLE_SID in $($ORACLE_HOME/bin/srvctl config database)   # Loop to extract SID names from file
do
export ORACLE_SID=$ORACLE_SID$Append
LOGFILE=${LOG}/${ORACLE_SID}_${FECHA}_${HORA}.log                           # Build log filename
exec >> ${LOGFILE} 2>&1                                                     # Write log
# RMAN execution; the client's RMAN script can go here
${ORACLE_HOME}/bin/rman <<EOF
connect target /
run {
backup database plus archivelog;
}
LIST BACKUP SUMMARY;
EOF
echo  Database: "${ORACLE_SID}" >> ${LOG}/mail         # Write the SID in mail log to send the name
cat ${LOGFILE} >> ${LOG}/mail                               # Read the log file and insert it into mail
done                                                        # End of Loop
grep RMAN-06273 ${LOG}/mail >>/dev/null                     # Look for RMAN error in case of failure.
if [ $? -eq 0 ]                                             # If not equal to 0, move on; if equal to 0, send alert email
then
ASUNTO='ALERT!: Backup of '${MAQUINA}' has failed'          # Alert 1 subject configuration
else
grep -i error ${LOGFILE} >>/dev/null                        # Look for the word "error"
if [ $? -eq 0 ]                                             # If not equal to 0, move on; if equal to 0, send alert email
then
ASUNTO='ALERT!: Backup of '${MAQUINA}' has failed'          # Alert 2 subject configuration
else
ASUNTO='Backup '${MAQUINA}' OK'                             # If everything is OK, send email with correct subject.
fi
fi
## Mail ##
cat ${LOG}/mail | /usr/bin/mailx -s "${ASUNTO}" "${CORREO}"     # Read the Mail file to send as email body.
rm -rf ${LOG}/mail                                              # Remove used log
echo $exit 0

On lines 17 to 21, where the RMAN backup instructions go, you can edit the script however you like. Just remember to change the email address and a few of the parameters shown, such as the node number where it runs. This script performs a full backup of the databases, including the ArchiveLogs.

For the more detail-minded: the script loops over the instances with a “for” loop using srvctl config database, appends the node number to the instance, enters RMAN and runs the backup. Once it finishes one instance, it moves on to the next until all of them are done.

When you run the backup script, you’ll get the following:

Veeam Oracle RMAN Plugin - screenshot 6

You’ll see the RMAN execution logs for each instance, and if you have mailx configured you’ll receive the successful-backup notification. You’ll also see the successful backup in Veeam Backup & Replication:

Veeam Oracle RMAN Plugin - screenshot 7

With that, our Oracle RAC instance backups are up and running with little effort. For example, if you want to schedule the backup, just add the backup.sh script to crontab on the days that suit you and edit the RMAN section to run the backup as needed, or run it with your preferred scheduler, or with Veeam Agent for Linux if you have it installed and are also backing up some files.

Recovery
#

Now that we have backups, they’ll show up in the Veeam Backup & Replication console menu, under the Disk backups section:

Veeam Oracle RMAN Plugin - screenshot 8

And we can select the backup to restore it if any problem arises:

Veeam Oracle RMAN Plugin - screenshot 9

And we can open Veeam Explorer for Oracle RMAN:

Veeam Oracle RMAN Plugin - screenshot 10

Select the database to recover and configure the requirements:

Veeam Oracle RMAN Plugin - screenshot 11

As always, it’s important to read the specific information in the Veeam manual:

https:// helpcenter.veeam.com /docs/ backup /explorers/veor_considerations.html?ver=100

You can also recover directly from RMAN with its respective commands.

Logs
#

If you run into installation or configuration problems, the log files are located at /tmp/veeam\_plugin\_logs, where you can look for errors or send them to Veeam support. The same goes for the logs generated by the addoratab.sh and backup.sh scripts, which are stored in /home/oracle/.

With that last section, we wrap up this first blog post :) What do you think for a first one? Leave a comment or give it a rating.

Frequently asked questions
#

Which user should I use to install and configure the Veeam Oracle RMAN Plugin?

Install the RPM package as the “root” user, but run the configuration as the Oracle user (usually “oracle”). If you configure the plugin as “root” you won’t have access to Oracle’s environment variables and will run into errors.

Why does the wizard show "Cannot find any Oracle instances" on an Oracle RAC?

Since Oracle 12.2.0.1.171017 (patches 26737266 and 26729536, MOS Doc ID 2329359.1) the /etc/oratab file is no longer updated with the instances running on the RAC, and the plugin reads that file to detect them. The recommended fix is to run the addoratab.sh script, which queries the RAC instances with crsctl and updates /etc/oratab automatically.

Do I need to install the plugin on every Oracle RAC node?

Yes, that’s the recommended approach. RMAN can choose which node to run the backup on thanks to a feature called RMAN Node Affinity Awareness, so the plugin must be present on all nodes.

How do I avoid reconfiguring the plugin every time I add an instance to the RAC?

The addoratab.sh script is already set up so that, once you schedule it in crontab as the “oracle” user (for example running daily), it automatically adds the new instance to /etc/oratab and reconfigures the Veeam Oracle RMAN Plugin with no manual intervention.

In which Veeam repository are the backups stored?

The available repositories depend on the “Access Permissions” settings in Veeam Backup & Replication. The Default Backup Repository is always allowed by default; the post recommends setting it to “Deny to Everyone” and enabling only the users or repositories you will actually use, such as a Scale-Out Backup Repository (SOBR).

How do I recover a database backed up with the plugin?

The backups appear in the Veeam Backup & Replication console under the Disk backups section. From there you select the backup and use Veeam Explorer for Oracle RMAN to choose the database and configure the restore, or you can recover directly with RMAN commands.

Related posts#