Introduction to SAP HANA and BACKINT interface
SAP HANA is a complete relational database and suite of accompanying management tools to store, recover, manipulate, and analyze data. Like any good RDBMS it provides advanced tools for analytics and analysis, and also functions to allow data to be backed up into a standardized format and recovered easily and accurately into a new database when necessary.
This article details the process of SAP HANA backup and recovery with the help of Bacula Enterprise’s multifunctional SAP HANA backup plugin leveraging the ‘backint’ interface. But first we’ll look at how SAP HANA backup and recovery process can be done using nothing but its own, built-in backup and recovery tools.
Native SAP HANA backup and recovery process
First of all, it’s important to mention that a person performing a SAP HANA backup would have to have either a “backup operator” or “backup admin” role assigned to their HANA database user account.
Knowing that your account has sufficient privileges, the first thing you’ll have to do is of course, to open up HANA studio and connect to the system that you want to make a backup of.
To start up the backup process you’ll have to right-click the system in question and choose the “Back Up System…” option.
By default the backup wizard launches with standard parameters for both “Backup destination” and “Backup prefix” fields. You can change the default backup destination path by modifying the “basepath_databackup” line in the global.ini file. The default value of this line is $(DIR_INSTANCE)/backup/data.
Of course, you can modify this specific operation’s backup destination, as well as the backup prefix, in the same first window of backup wizard that we’ve just opened.
You can also see that the backup estimate can be seen from the first step of the backup process, close to the header of the wizard window. Clicking “Next” within this same window would lead you to the finalization screen that shows all of your future backup settings.
Clicking “Finish” in that window would start up the backup process. The entire process is also displayed in the separate wizard window, as follows:
As soon as the backup process shows a complete 100% everywhere, the process is complete and the backup files are created. It’s also possible to double-check the creation of the backup files via the command line.
Another way of performing backups with only the most basic SAP HANA capabilities is via the SQL command and through the SQL console. The command itself is as follows:
BACKUP DATA USING FILE (*****);
The ***** part represents the target backup destination and should be entered with single brackets on both sides, for example – (‘/usr/backup/data’).
Recovery part of your SAP HANA backup and recovery process is relatively simple, as well. You’re starting up in the same way as the backup process, but looking for the “Recover System…” option instead.
The first choice that you’ll have in this process is the recovery type. SAP HANA backup and recovery built-in software supports three main recovery types:
- Most recent state. For this recovery option to work properly you’ll have to have an entire last backup and logs available to be able to restore it.
- Specific point in time. This option attempts to restore the backup that’s closest to the point in time that you’re choosing.
- Specific data backup. Gives you a list of currently stored backups, and you can restore any one of the ones that you have.
Choose whichever you want and click “Next” in this window.
In some cases you’ll have to confirm the location of the backup catalog, as well. As soon as you’re ready, click “Next”. You’ll receive a notification warning you about the need to stop the database in question to perform a restoration process.
Clicking “Ok” on this notification would stop the database in question and take you to the next screen. Next you’ll have to confirm both the last backup that’ll be restored and the location of the log backups. The last two screens that you’ll see before the restoration process begins are the “Other settings” window and the “Review Recovery Settings” window. Choosing “Finish” at the end of the “Review Recovery Settings” window would start up the recovery process.
The recovery process itself is split in three phases: data recovery, log recovery and database restart. After all three of the phases are done, you’ll be given the “Recovery Execution Summary” window about either success or a failure of the recovery process. Clicking “Close” on this window finishes up the recovery process for your SAP HANA database.
After seeing how it works with the built-in tools, now we’ll go over Bacula Enterprise’s way of doing it.
Manually creating SAP HANA backup jobs
Although normally the process of both backing up and recovering your SAP HANA database is automated using Bacula Enterprise or your specific SAP HANA infrastructure, we’ll go through the process of doing so manually using Bacula Enterprise’s SAP HANA plugin and the Bacula bconsole command line. The manual backup and restore procedure is chosen here to show all of the steps of this specific process.
SAP HANA backup configuration
To begin, SAP HANA backup plugin must be configured so that the Bacula Enterprise server and the SAP HANA backint process can authenticate and share data. This potentially complex process can be automated by running the included configuration script, which will prompt the user for the necessary SAP HANA information and store it for future backup jobs. Once this configuration script has successfully executed, backup jobs can be scheduled for regular operation or can be run manually.
Manual SAP HANA backup initiation
Next, let’s go through the process of initiating a backup job manually. The first step is to log in to a SAP HANA interactive console. The backint command is configured to send data directly to the Bacula Enterprise server. When running manually, you can also specify a job name and timestamp.
After running that command you should be able to see your brand new backup jobs, created by the backint command.
Backup administration using SAP HANA studio
There’s also a graphical way of managing backups that you’ve created, and it’s done with the help of a SAP HANA admin console, also called “SAP HANA studio”. This graphical interface allows you to initiate backups and also makes it easy to schedule runs of backint to initiate Bacula SAP HANA plugin backups. This leaves control of backup scheduling with the DBA, which is often preferable.
Regardless of how the job is initiated, you have a very detailed log of every job available via BWeb by clicking on the status icon in the same line as your backup job is (if the job is done correctly, it should be a white checkmark with a green background). For example, here is the backup job that was created in the previous steps, the first line is showing that there is a connection between the SAP HANA database and the server, and the rest of it is a detailed steps of the whole process, including the total size of your backup, how many files are in it, what’s the compression rate and so on. And the very last line should, of course, be the confirmation that everything went right – an OK status.
Manually creating SAP HANA recovery jobs
Now let’s move on to the SAP HANA recovery process. There are many ways to recover a database, including restoring a backup from previously mentioned SAP HANA studio or directly restoring a backup through the same backint command, but for the sake of simplicity in this example we’ve used the Bacula Enterprise user-friendly recovery script. All you need to do is specify a restoration point-in-time and the recovery script handles the rest.
After executing the script , recoverSys leads the process to check the database in question, to stop it if it’s running, connect to the Bacula Enterprise servers and to restore the data you need. Once the restore finishes you’ll see the console outputs showing that the process was a success.
You can also check BWeb to see your restore job logs and see in detail how the process went and that it was a success (confirming what was shown via the command line restore script).
As you can see, Bacula Enterprise’s SAP HANA backup and recovery plugin is capable of both backing up and recovering your critical data within SAP HANA databases and provides a number of options to script and automate the process or to leave it in the hands of the SAP HANA DBA. The Bacula Enterprise SAP HANA plugin is SAP certified to protect your data.