Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
dvankempen
Product and Topic Expert
Product and Topic Expert
Recently, we have published a number of new tutorial videos to the SAP HANA Express edition playlist on our SAP HANA Academy YouTube Channel.

In this playlist you will find video tutorials on miscellaneous topics; some included in the Getting Started with SAP HANA express edition guide (PDF) that comes with the download, others not (yet).

How to backup a (tenant) database is such a topic.

If you are not familiar yet with the topic of backup and recovery for SAP HANA in general, please see my blog or check out the Backup and Recovery playlist on the Academy: http://bit.ly/2eNfXJf

There a three tools you can use to make a backup of your SAP HANA database:

  • SAP HANA cockpit

  • SAP HANA studio

  • hdbsql


For the VM, I should maybe add that you can also - of course - create a snapshot of the VM but this does require quite a bit of hard disk space.

SAP HANA cockpit

Using the SAP HANA cockpit is probably the easiest way to perform database backups.

To enable this, you have to add the backup administrator role.
call GRANT_ACTIVATED_ROLE ('sap.hana.backup.roles::Administrator', 'SYSTEM');

This will add the SAP HANA backup catalog to the cockpit and add the Data Backup tile to the dashboard.

You can access the SAP HANA cockpit with URL:
http://hxehost:8000/sap/hana/admin/cockpit

See below for a tutorial video on how you can add the hostname of the VM to the hosts file of your PC or Mac.



Select the tile to open the Backup Catalog app and click Create Backup. Optionally, edit the backup type, prefix, or destination and select Back Up.



SAP HANA studio

To backup a database using SAP HANA studio, just open the Backup Editor in the Systems View and open the Backup Wizard. The SYSTEM user already has the BACKUP ADMIN system privilege so there is no need to add any privileges to use this tool.

See below for a tutorial video on how you can connect SAP HANA studio to the SAP HANA express edition VM.



In the wizard you can then specify the backup settings, same as for SAP HANA cockpit.



Command line (hdbsql)

Finally, you can use the command line tool to perform the backup using SQL. This way you can easily automate the backup to be executed at a set time (using cron), for example, each time you start the VM.

To do this securely, it is recommended to use a secure store key file and use the restricted privileges of the BACKUP OPERATOR role.
## execute command with user key
# hdbuserstore -i SET backup hxehost:30013 backup_operator
hdbsql -U backup "backup data using file ('$BACKUP_PREFIX')"
hdbsql -U backup "backup data for $TENANT using file ('$BACKUP_PREFIX')"

If you have setup shared folders for the VM, you can even copy a zipped backup directly to the host computer.

So how can you do this? It is simple.

1. Watch the video



2. Use the code sample from Github

https://github.com/saphanaacademy/HXE/blob/master/backup/backup.sh

How to?


Blog Series


This blog is part of a series:




 

Help Portal

SAP HANA Database Backup and Recovery

SAP Notes

1642148 - FAQ: SAP HANA Database Backup & Recovery

 

Thank you for watching


The SAP HANA Academy provides free online video tutorials for the developers, consultants, partners and customers of SAP HANA.

Topics range from practical how-to instructions on administration, data loading and modeling, and integration with other SAP solutions, to more conceptual projects to help build out new solutions using mobile applications or predictive analysis.

For the full library, see SAP HANA Academy Library - by the SAP HANA Academy.

For the full list of blogs, see Blog Posts - by the SAP HANA Academy.
2 Comments