LLI Wiki — My Digital Knowledge Base

SAP HANA backup with Veeam: snapshot and Backint plug-in

Install and configure SAP HANA backup on Linux with Veeam: pre-freeze/post-thaw scripts, SAP HANA plug-in, retention and Ansible update.

This article describes how to back up an SAP HANA database on Linux with Veeam Backup & Replication: VM snapshot backup (pre-freeze / post-thaw scripts) and the Veeam Plug-in for SAP HANA (Backint). Official references: Configure the SAP HANA plug-in and SAP HANA plug-in garbage collector.

Prerequisites

Snapshot backup: preparing the HANA server

  1. Create the user Veeam will use, with a fixed uid and the SAP groups:
sudo useradd veeam_svc -g sapsys -G sapsys,hhdshm -u 8502
sudo passwd veeam_svc

The hhdshm group is your HANA SID's group (<sid>shm); adapt the name.

  1. Put the SSH public key in the user's authorized keys:
sudo su - veeam_svc
mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
# copy the authorized public key, for example from another host
scp adminhost:~/.ssh/authorized_keys ~/.ssh/
  1. Allow the user in sudoers:
sudo visudo -f /etc/sudoers.d/veeam_svc
veeam_svc ALL=(ALL) NOPASSWD:ALL
  1. Create the configuration file read by the pre-freeze / post-thaw scripts:
sudo mkdir -p /etc/veeam
sudo vim /etc/veeam/hana.conf
# Config file for HANA pre-freeze/post-thaw scripts
# To use standard username/password, set values here
username="SYSTEM"
password=<PASSWORD>
# To use key-based authentication, enter a key prefix here (default is HDB)
keyprefix="HDB"
# Log purge options
purgelogs="false"
purgedays="3"
sudo chmod 775 /etc/veeam
sudo chmod 664 /etc/veeam/hana.conf
  1. In Veeam, create the VM backup job with application-aware processing enabled, referencing the hana-pre-freeze.sh and hana-post-thaw.sh scripts.

Veeam: credentials manager, Linux account with sudo elevation

Veeam: backup repository access permissions

Veeam: snapshot backup job result

Veeam: job virtual machine selection

Veeam: job Storage step (proxy, repository, retention)

Veeam: application-aware processing and pre-freeze / post-thaw scripts

Installing the plug-in

  1. Copy the RPM to /tmp (for example with WinSCP), then install it as root:
sudo rpm -i /tmp/VeeamPluginforSAPHANA-<version>.x86_64.rpm
  1. Identify the <sid>adm user that owns the HANA processes:
ps -ef | grep hdb

The owner of the hdb... processes (for example hhdadm) is the relevant SAP user. It is referenced in the configuration and used for the post-installation steps.

  1. Run the plug-in configuration wizard:
sudo SapBackintConfigTool --wizard

The wizard asks for:

At the end, the message SID <sid> has been configured should appear.

  1. Check the configuration file:
cat /opt/veeam/VeeamPluginforSAPHANA/veeam_config.xml

Example content, with the retention (backupExpiredTimeDays) and a repository free-space warning threshold (repositoryFreeSpacePercentWarning) added to PluginParameters:

<Config>
    <CAVerificationParameters />
    <AdditionalCertificatePaths />
    <ProxyConfig />
    <VBRConnectionParams vbrHostName="veeamserver01.example.com" vbrPort="10006" vbrUser="hana_veeam" vbrDomain="" vbrPassword="<PASSWORD>" />
    <Certificate />
    <BackupForRestoreParams />
    <AgentParams />
    <RepositoryParams>
        <Repository repositoryName="Backup Repository" repositoryID="00000000-0000-0000-0000-000000000000" />
    </RepositoryParams>
    <PluginParameters backupExpiredTimeDays="365" repositoryFreeSpacePercentWarning="3" />
    <ClusterParams isCluster="false" />
    <SourceServerParams />
</Config>

For the Oracle RMAN plug-in, the same principle applies in /opt/veeam/VeeamPluginforOracleRMAN/veeam_config.xml.

Scheduled backup script

To drive the backup from a scheduler (for example a job scheduler):

  1. Copy the backup script (full / differential) to a dedicated directory, for example /home/<user>/scripts/backupFullDiff_hana.sh.
  2. Give the user access rights to the HANA database.
  3. Make the script executable: chmod 775 /home/<user>/scripts/backupFullDiff_hana.sh.
  4. Test it manually, then from the scheduler.

Check that the SAP service is running:

systemctl status sapinit

Post-installation

sudo chown <sid>adm:sapsys -R /hana/backup/
ls -altr /hana/backup/
./SapBackintConfigTool --set-force-delete

with a retention of 365 days in this example.

Deployment and update with Ansible

If you manage your servers with Ansible, the plug-in and its configuration file can be deployed or updated with dedicated playbooks:

ansible-playbook -i inventory/hana.yml playbooks/update_veeam_hana_plugin.yml
ansible-playbook -i inventory/hana.yml playbooks/update_hana_config.yml

Notes

Mastodon LLIMastodon SocialFosstodon