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.
There a three tools you can use to make a backup of your SAP HANA database:
- SAP HANA cockpit
- SAP HANA studio
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:
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
- Configure a static IP for the VM
- Connect to the VM with SAP HANA studio
- Install or update VMware tools
- Use cron to schedule scripts
This blog is part of a series:
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.