|
| 1 | +--- |
| 2 | +title: Backup a SAP HANA database solution |
| 3 | +slug: backup-sap-hana |
| 4 | +excerpt: This guide provides you with general guidelines on how to backup a SAP HANA database. |
| 5 | +section: Advanced usage |
| 6 | +order: 01 |
| 7 | +updated: 2022-03-28 |
| 8 | +routes: |
| 9 | + canonical: 'https://docs.ovh.com/gb/en/sap/backup-sap-hana/' |
| 10 | +--- |
| 11 | + |
| 12 | +**Last updated 28th March 2022** |
| 13 | + |
| 14 | +## Overview |
| 15 | + |
| 16 | +OVHcloud provides SAP certified hardware on which to build a SAP HANA solution. |
| 17 | + |
| 18 | +This guide provides you with general guidelines on how to backup a SAP HANA database hosted on OVHcloud hardware. |
| 19 | + |
| 20 | +We will be setting up a SAP HANA backup architecture using the OVHcloud Veeam Backup & Replication Enterprise offer. |
| 21 | + |
| 22 | +Veeam Enterprise is an OVHcloud service that enables you to use Veeam Backup & Replication on your own infrastructure with a Veeam Enterprise Plus level licence. |
| 23 | + |
| 24 | +*** NB: You can use any SAP approved solution to setup your backup infrastructure *** |
| 25 | + |
| 26 | +> [!warning] |
| 27 | +> |
| 28 | +> While the material contained in this guide has been formulated with all due care, OVHcloud does not warrant or represent that the material constitutes an official SAP guide. |
| 29 | +> |
| 30 | +> All technical integration, installation and/or administration tasks of SAP solutions shall be validated by a SAP professional. |
| 31 | +
|
| 32 | +## Requirements |
| 33 | + |
| 34 | +- SAP HANA database access |
| 35 | +- A database user with the backup rights/role |
| 36 | + |
| 37 | +## Instructions |
| 38 | + |
| 39 | +Find below an index of the steps described in this guide: |
| 40 | + |
| 41 | +[1. Setting up the backup user](#backup-user)<br> |
| 42 | +[2. Setting up Veeam Backup & Replication](#veeam-setup)<br> |
| 43 | +[3. Setting up the backup](#backup-setup)<br> |
| 44 | +[4. Housekeeping](#housekeeping)<br> |
| 45 | + |
| 46 | +### Setup of the backup user <a name="backup-user"></a> |
| 47 | + |
| 48 | +#### Creating a user with a password |
| 49 | + |
| 50 | +Through the SQL command line interface or SAP HANA studio, create a backup user with the appropriate backup permissions: |
| 51 | + |
| 52 | +```bash |
| 53 | +CREATE USER backup_user PASSWORD enterpasswordhere NO FORCE_FIRST_PASSWORD_CHANGE; |
| 54 | +ALTER USER backup_user DISABLE PASSWORD LIFETIME; |
| 55 | +CREATE ROLE BACKUP_ROLE; |
| 56 | +GRANT BACKUP ADMIN, CATALOG READ, MONITORING TO BACKUP_ROLE; |
| 57 | +GRANT BACKUP_ROLE TO backup_user; |
| 58 | +``` |
| 59 | + |
| 60 | +#### Creating a user with the secure user store (hdbuserstore) |
| 61 | + |
| 62 | +The secure user store (hdbuserstore) is a tool installed with the SAP HANA client. Use it to store connection information to SAP HANA systems securely on the client so that client applications can connect to SAP HANA without users having to enter this information. |
| 63 | + |
| 64 | +It is typically used by scripts connecting to SAP HANA. |
| 65 | + |
| 66 | +For more information and how to set it up, please refer to the [SAP Documentation](https://help.sap.com/viewer/b3ee5778bc2e4a089d3299b82ec762a7/2.0.05/en-US/dd95ac9dbb571014a7d7f0234d762fdb.html){.external} |
| 67 | + |
| 68 | +### Veeam Backup & Replication Setup <a name="veeam-setup"></a> |
| 69 | + |
| 70 | +For our backup needs, we will use the [OVHcloud Veeam Enterprise product](https://www.ovhcloud.com/de/storage-solutions/veeam-enterprise/). |
| 71 | + |
| 72 | +You can find the OVHcloud installation guide [here](https://docs.ovh.com/de/storage/veeam-backup-replication/) |
| 73 | + |
| 74 | +#### Network Flows |
| 75 | + |
| 76 | +|Source Address|Source Port|Destination address|Destination port|Protocol|Comments| |
| 77 | +|---|---|---|---|---|---| |
| 78 | +|SAP HANA|any|Veeam Backup&Replication|10006|TCP|Default port used for communication with the Veeam Backup & Replication server. Note that data between Veeam Plug-ins and backup repositories is transferred directly, bypassing the Veeam Backup & Replication server.| |
| 79 | +|SAP HANA|any|Veeam Backup Repository|2500 to 3300|TCP|Default range of ports used as data transmission channels. For every TCP connection that a backup process uses, one port from this range is assigned.| |
| 80 | +|Veeam Backup & Replication|any|Veeam Backup Repository|2500 to 3300|TCP|Default range of ports used as data transmission channels. For every TCP connection that a backup process uses, one port from this range is assigned| |
| 81 | +|Veeam Backup & Replication|any|Linux server used as a backup repository or gateway server|22|TCP|Port used as a control channel from the Veeam Plug-in server to the target Linux host| |
| 82 | +|Veeam Backup & Replication|any|Microsoft Windows Server used as a backup repository or gateway server|135, 137 to 139, 445|TCP/UDP|Ports used as a management channel from the Veeam Plug-in server to the Repository/Gateway server. Also, the ports are used to deploy Veeam components| |
| 83 | +|Veeam Backup & Replication|any|Microsoft Windows Server used as a backup repository or gateway server|6160, 6162|TCP|Default ports used by the Veeam Installer Service and Veeam Data Mover Service| |
| 84 | + |
| 85 | +#### Setting up Backup Repositories |
| 86 | + |
| 87 | +After installation of the Veeam Backup & Replication solution, you may proceed with the Backup Reposistory setup. |
| 88 | + |
| 89 | +A Backup Repository is a storage space where Veeam B&R stores backup files and meta-data for replicated VMs. |
| 90 | + |
| 91 | +To add a new backup repository: |
| 92 | + |
| 93 | +- Launch the New Backup Repository wizard |
| 94 | +- Specify a Backup Repository Name and Description |
| 95 | +- Specify Server or Shared Folder Settings |
| 96 | +- Configure Path and Load Control Settings |
| 97 | +- Specify Mount Server Settings |
| 98 | +- Review Properties and Components |
| 99 | +- Apply Backup Repository Settings |
| 100 | +- Review settings of the newly created standard backup repository and click Finish |
| 101 | + |
| 102 | +*** For more information, please check the [Veeam Backup Repository documentation](https://helpcenter.veeam.com/archive/backup/100/vsphere/repo_add.html){.external} *** |
| 103 | + |
| 104 | +#### Setting up Scale Out Backup Repositories |
| 105 | + |
| 106 | +After the setup of your backup repositories, you may want to extend the backup repositories you created. |
| 107 | + |
| 108 | +This step is optional but strongly suggested in order to secure your data in another location. |
| 109 | + |
| 110 | +##### **Using Object Storage (Public Cloud)** |
| 111 | + |
| 112 | +Object storage offers a number of advantages, the main one being reduced costs as your data grows. Your data is stored on one or more servers sized to accommodate terabytes or even petabytes of information, while optimising operational costs. |
| 113 | + |
| 114 | +The environment is also designed to adapt to changing needs, without needing to overhaul the infrastructure or the way it runs |
| 115 | + |
| 116 | +Therefore, we will use the [OVHcloud Object Storage product](https://www.ovhcloud.com/de/public-cloud/object-storage/) to extend our previously created Scale-Out Backup Repository |
| 117 | + |
| 118 | +> [!primary] |
| 119 | +> For the time being, Veeam Backup and Replication only supports object storage as a capacity tier of scale-out backup repositories. |
| 120 | +> |
| 121 | +
|
| 122 | +Requirements: |
| 123 | + |
| 124 | +- an OVHcloud NIC Handle |
| 125 | +- a [Public Cloud Project](https://docs.ovh.com/de/public-cloud/create_a_public_cloud_project/) |
| 126 | + |
| 127 | + |
| 128 | +<ol start="1"> |
| 129 | + <li>Log in to the <a class="external-link" href="https://www.ovh.com/auth/?action=gotomanager&from=https://www.ovh.de/&ovhSubsidiary=de" rel="nofollow">OVHcloud Control Panel</a>, go to the <code class="action">Public Cloud</code> section, select your project then click <code class="action">Object Storage</code> and finally click on <code class="action">Create an object container</code>.</li> |
| 130 | +</ol> |
| 131 | + |
| 132 | +{.thumbnail} |
| 133 | + |
| 134 | +<ol start="2"> |
| 135 | + <li>Select <code class="action">Standard (Swift)</code>:</li> |
| 136 | +</ol> |
| 137 | + |
| 138 | +{.thumbnail} |
| 139 | + |
| 140 | +<ol start="3"> |
| 141 | + <li>Select the region. ex: 'Gravelines (GRA)':</li> |
| 142 | +</ol> |
| 143 | + |
| 144 | +{.thumbnail} |
| 145 | + |
| 146 | +<ol start="4"> |
| 147 | + <li>Select the <code class="action">Private</code> container type:</li> |
| 148 | +</ol> |
| 149 | + |
| 150 | +{.thumbnail} |
| 151 | + |
| 152 | +<ol start="5"> |
| 153 | + <li>Give a name to your container:</li> |
| 154 | +</ol> |
| 155 | + |
| 156 | +{.thumbnail} |
| 157 | + |
| 158 | +You container will now be present on the list, as shown below: |
| 159 | + |
| 160 | +{.thumbnail} |
| 161 | + |
| 162 | +<ol start="6"> |
| 163 | + <li>Go to <code class="action">s3 users</code> tab to create a user:</li> |
| 164 | +</ol> |
| 165 | + |
| 166 | +{.thumbnail} |
| 167 | + |
| 168 | +***N.B : Store the password associated to this user in a password manager as it will be provided just once.*** |
| 169 | + |
| 170 | +<ol start="7"> |
| 171 | + <li>Give the <code class="action">Object Storage Operator</code> role for this user on <code class="action">Users & Roles</action> tab :</li> |
| 172 | +</ol> |
| 173 | + |
| 174 | +{.thumbnail} |
| 175 | + |
| 176 | +<ol start="8"> |
| 177 | + <li>Select the user and download the OpenStack configuration file:</li> |
| 178 | +</ol> |
| 179 | + |
| 180 | +{.thumbnail} |
| 181 | + |
| 182 | +<ol start="9"> |
| 183 | + <li>Install the OpenStack & Nova client:</li> |
| 184 | +</ol> |
| 185 | + |
| 186 | +```bash |
| 187 | +sudo apt-get install python3-openstackclient python3-novaclient -y |
| 188 | +``` |
| 189 | + |
| 190 | +<ol start="10"> |
| 191 | + <li>Once the installation is finished, source the .sh script file:</li> |
| 192 | +</ol> |
| 193 | + |
| 194 | +```bash |
| 195 | +source xxxxxxxxxxxxxxxxxx-openrc.sh |
| 196 | +``` |
| 197 | + |
| 198 | +> [!primary] |
| 199 | +> Save the password in your favorite password manager. |
| 200 | +
|
| 201 | +<ol start="11"> |
| 202 | + <li>Create the credentials:</li> |
| 203 | +</ol> |
| 204 | + |
| 205 | +```bash |
| 206 | +openstack ec2 credentials create |
| 207 | +``` |
| 208 | + |
| 209 | +<ol start="12"> |
| 210 | + <li>Now we can add the object storage container as a backup repository on our Veeam infrastructure with the access & secret key provided above</li> |
| 211 | +</ol> |
| 212 | + |
| 213 | +{.thumbnail} |
| 214 | + |
| 215 | +{.thumbnail} |
| 216 | + |
| 217 | +{.thumbnail} |
| 218 | + |
| 219 | +{.thumbnail} |
| 220 | + |
| 221 | +{.thumbnail} |
| 222 | + |
| 223 | +{.thumbnail} |
| 224 | + |
| 225 | +{.thumbnail} |
| 226 | + |
| 227 | +<ol start="13"> |
| 228 | + <li>Now we can specify this repository as an extension of one of our SOBR:</li> |
| 229 | +</ol> |
| 230 | + |
| 231 | +{.thumbnail} |
| 232 | + |
| 233 | +### Setting up the backup <a name="backup-setup"></a> |
| 234 | + |
| 235 | +#### File System Backup |
| 236 | + |
| 237 | +File System Backups write all data to files (for example an NFS share that is available for all nodes). |
| 238 | + |
| 239 | +Make sure to monitor the fill level of your file system during the backup operations. |
| 240 | + |
| 241 | +The File System Backups can be configured through these options: |
| 242 | + |
| 243 | + - Manually in HANA Studio |
| 244 | + - SQL Script (manual/external scheduler) |
| 245 | + - SAP DBA Cockpit (external scheduler) |
| 246 | + |
| 247 | +If you want to protect the SAP HANA server itself, you can use the image-level and file-level backup functionality of Veeam Backup & Replication or Veeam Agent for Linux. |
| 248 | + |
| 249 | +Note that image-level and file-level backups of SAP HANA servers do not guarantee transaction-consistency of database backups. |
| 250 | + |
| 251 | +#### Scheduling backups |
| 252 | + |
| 253 | +The HANA database Backups can be scheduled through these options: |
| 254 | + |
| 255 | +- In HANA Studio |
| 256 | +- SQL Script (manual/external scheduler) |
| 257 | +- SAP DBA Cockpit (external scheduler) |
| 258 | + |
| 259 | +##### **Scheduling a filesystem backup script** |
| 260 | + |
| 261 | +To backup your HANA instance to file system, please refer to [SAP NOTE 1950261](https://launchpad.support.sap.com/#/notes/1950261){.external} |
| 262 | + |
| 263 | +##### **Backint API Backup** |
| 264 | + |
| 265 | +Backint for SAP HANA is an API that enables 3rd party tool vendors to directly connect their backup agents to the SAP HANA database. |
| 266 | + |
| 267 | +To enable backuping through the backint API, a Veeam plugin installation and setup is required on the server hosting the HANA database. |
| 268 | + |
| 269 | +Here is how the backup operates: |
| 270 | + |
| 271 | +<ol start="1"> |
| 272 | + <li>HANA starts the backup.</li> |
| 273 | + <li>Veeam Plugin for SAP HANA assigns multiple streams to backup target.</li> |
| 274 | + <li>Data is stored in the Veeam backup repository</li> |
| 275 | +</ol> |
| 276 | + |
| 277 | +*** For more information, please check the [Veeam Plugin for SAP-HANA documentation](https://helpcenter.veeam.com/docs/backup/plugins/sap_hana_plugin.html?ver=100){.external} *** |
| 278 | + |
| 279 | +To Install the plugin: |
| 280 | + |
| 281 | +1. Copy the VeeamPluginforSAPHANA from the Veeam Backup and Replication Installation ISO to the HANA-DB server |
| 282 | +2. Run the rpm package install |
| 283 | + |
| 284 | +```bash |
| 285 | +rpm -i VeeamPluginforSAPHANA-10.x.x.xxxx-x.x86_64.rpm |
| 286 | +``` |
| 287 | + |
| 288 | +You can then configure the plugin: |
| 289 | + |
| 290 | +1. Log in with operating system user (<sid>adm) |
| 291 | +2. Run the backint plugin configuration wizard: |
| 292 | + |
| 293 | +```bash |
| 294 | +SapBackintConfigTool --wizard |
| 295 | +Enter backup server name or IP address: 172.x.x.x |
| 296 | +Enter backup server port number [10006]: |
| 297 | +#NB: The used account must have access to Veeam backup repositories that you plan to use. |
| 298 | +Enter username: xx-backup-ovh\svc_veeam_hana |
| 299 | +Enter password for xx-backup-ovh\svc_veeam_hana: |
| 300 | +Available backup repositories: |
| 301 | +1. Backup Repository |
| 302 | +#Select the backup repository where the HANA-db backups will be stored |
| 303 | +Enter repository number: 1 |
| 304 | +Configuration result: |
| 305 | + SID xxx has been configured |
| 306 | +``` |
| 307 | + |
| 308 | +#### Scheduling backint backups |
| 309 | + |
| 310 | +The Veeam plugin automatically creates a backup job and transfers data according to the backup schedule you have set. |
| 311 | + |
| 312 | +If you run a manual backup through the backint, it will therefore automatically be pushed to the Veeam BR solution. |
| 313 | + |
| 314 | +> [!primary] |
| 315 | +> All SAP HANA jobs can be monitored within the Veeam Backup & Replication console. |
| 316 | +
|
| 317 | +### Housekeeping <a name="housekeeping"></a> |
| 318 | + |
| 319 | +It is recommended to regularly delete full backups and backup generations that are no longer needed to recover your SAP HANA database. |
| 320 | + |
| 321 | +Failing to do so might result in a full backup volume and block new backup generation. |
| 322 | + |
| 323 | +For more information, please refer to the official SAP guides: |
| 324 | + |
| 325 | +[Housekeeping: Deleting and Archiving Backups](https://help.sap.com/viewer/afa922439b204e9caf22c78b6b69e4f2/2.13.0.0/en-US/cac903c28b0e4301b39814ef41dbf568.html){.external} |
| 326 | + |
| 327 | +[2399996 - How-To: Configuring automatic SAP HANA Cleanup with SAP HANACleaner](https://launchpad.support.sap.com/#/notes/2399996){.external} |
0 commit comments