cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Backup Automation Bash Script

06-10-2021 7:51 AM
charithw Explorer
3420 views 5 comments
0 Likes
SAP Managed Tags
Subscribe

i have used the below script to automate the HANA backup and its working fine. but i would need to take the system DB backup as well. if i add "for SYSTEMDB" is giving below error

Error : 7: feature not supported: Invalid options FULL SYSTEM / FOR DATABASE (only on SYSTEMDB) SQLSTATE: HY000

#!/bin/sh

#/* Backup script */

source $HOME/.bashrc

date="$(date +"%Y-%m-%d")"

time="$(date +"%Y-%m-%d %H:%M:%S")"

backup="backup data using file ('$date')"

echo "daily backup :" $time "Start" >> $DIR_INSTANCE/backup.log

$DIR_EXECUTABLE/hdbsql -U backup -x $backup

time="$(date +"%Y-%m-%d %H:%M:%S")"

echo "daily backup :" $time "End" >> $DIR_INSTANCE/backup.log

Thanks

Ruchira Senevirathne

0 Likes

Accepted Solutions (0)

Answers (2)

Answers (2)

HakanHaslaman
Product and Topic Expert
Product and Topic Expert

I see the same error, if run a Backup via HDBSQL and the connection was done to the Tenant DB instead of the System DB.

Please check the attachment of https://launchpad.support.sap.com/#/notes/1651055 and check, if this helps you further https://developers.sap.com/tutorials/hxe-ua-dbfundamentals-backups.html (in the last part of the page)

charithw
Explorer
0 Likes

Hi Hakan Haslaman,

Thank you for the details. 🙂

Thanks

Ruchira

dvankempen
Product and Topic Expert
Product and Topic Expert

Hi Ruchira,

Note that the documented approach is to use SAP HANA cockpit

Note that Note 1651055 dates was last updated in 2014 (SAP HANA 1.0 SPS 08), long before multi-tenant databases, XS advanced, and the scheduling functionality of SAP HANA cockpit. According to the author "one of the most stupid things I’ve done in my life"

See also

At the time, DBACOCKPIT was most commonly used as most systems hosted Business Suite or Business Warehouse applications.

charithw
Explorer

Hi Denys,

Thank you for the details.

since i was struggling to take bash script backup for SYSTEMDB, if I use the below parameter will resolve the issue right?

B.SERVICE_TYPE_NAME='nameserver'

Thanks

Ruchira

dvankempen
Product and Topic Expert
Product and Topic Expert

Looks about right (without documentation) but double check the syntax to see that the query retuns a result set and not an answer.