Learn how to complete common tasks when setting up a new database. In this tutorial, you will create a backup for your database using HANA cockpit, HANA studio, or SQL.
Note:
This option requires an SAP HANA, express edition Server + Applications installation.
Open SAP HANA Cockpit and log in using XSA_ADMIN.
Open your system database in the Resource Directory window.
Scroll down to the System DB Monitoring and Administration section and click Manage database backups under Administration.
Manage Database Backups
On the bottom right of the page, click Create Backup.
Create Your Backup
Select your Backup Type and Destination Type. You may also change the Backup Prefix and Backup Destination. By default the values for Backup Prefix and Backup Destination are <date>_<time> and /usr/sap/<sid>/HDB90/backup/data/SYSTEMDB/.
Click Back Up to create your backup.
Create Backup
A new page will open with a progress bar. Creating your backup will take a few minutes.
Once the backup is complete, a new page will show your successful backup. Two files are created: <backup_prefix>_databackup_0_1 and <backup_prefix>_databackup_1_1.
Successful Backup
Step 2SAP HANA Studio
+
On SAP HANA Studio, log on to your SAP HANA, express edition installation.
Double-click the Backup iconBackup.
If this is your first backup, under the Overview tab, click back up now. If this is not your first backup, click the Open Backup Wizard iconBackupby Status of Currently Active Data Backup.
SAP HANA Studio Backup
The backup window opens.
Choose your Backup Type and Destination Type as necessary. By default, the values are Complete Data Backup and File.
Choose your Backup Destination and Backup Prefix. This will be where your files are stored and what they will be called. By default, the values are /usr/sap/<sid>/HDB<instance_number>/backup/data/SYSTEMDB and COMPLETE_DATA_BACKUP.
When you are finished, click Next >.
Backup Window
Review your backup settings and click Finish to begin creating your backup. Creating your backup will take a few minutes.
Step 3SQL and Command Line
+
In SAP HANA Studio or another connected SQL command line, create a backup user and grant it backup permissions.
Shell
CREATE USER backup_operator PASSWORD <password> NO FORCE_FIRST_PASSWORD_CHANGE;GRANT BACKUP OPERATOR to backup_operator;ALTER USER backup_operator DISABLE PASSWORD LIFETIME;
This creates the user backup_operator with the given password and tells the system to not require a password change upon first login. It gives also gives backup_operator permission to make backups. You will be using this user to only create backups so logging in for each backup is not required. You only need to do this once.
Connect to your SAP HANA, express edition installation using a command line.
Log in as hxeadm.
Shell
su -l hxeadm
Create the backup key.
Execute the following command to create the user key backup.
Shell
hdbuserstore -i SET backup <hostname>:3<instance_number>13 backup_operator
Create the file backup.sh.
Shell
vi backup.sh
Copy and paste the following code:
Shell
## defines backup prefixTIMESTAMP="$(date +\%F\_%H\%M)"BACKUP_PREFIX="SCHEDULED"BACKUP_PREFIX="$BACKUP_PREFIX"_"$TIMESTAMP"# TENANT="<tenant_database_name>"## runs the backup sequence using the backup keyhdbsql -U backup "backup data using file ('$BACKUP_PREFIX')"# hdbsql -U backup "backup data for $TENANT using file ('$BACKUP_PREFIX')"
This script will be used to create your backups. If you need to backup more than one database (you have tenant databases, for example), use the commented sections as a template.
Give backup.sh run permission.
Shell
chmod u+x backup.sh
Run backup.sh.
Shell
<location_of_backup_script>/backup.sh
Example:
Code
/hana/shared/HXE/HDB90/backup.sh
Wait while your backup is created.
(Optional) Check your backup repository to ensure your backup was created.
Shell
ls /usr/sap/<sid>/HDB<instance_number>/backup/data/SYSTEMDB
Share feedback on this tutorial or join the conversation in SAP Community.
Submit detailed feedbackDiscuss in Community
Steps
Step 1 of 3
1. SAP HANA Cockpit2. SAP HANA Studio3. SQL and Command Line
Joule
AI Notice
Joule is an AI assistant. Generative AI may produce inaccurate, incomplete, or biased information. Always verify important details before acting on them.
Conversations are sent to SAP-hosted large language models for processing. Do not include personal data, credentials, or confidential information in your messages.
Joule's responses are based on the SAP tutorial catalog and may not reflect the latest product changes. For authoritative guidance, consult the linked tutorials and official SAP documentation.