Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Implementing Python hook SAPHanaSR in SLES

Focus mode
Implementing Python hook SAPHanaSR in SLES - SAP HANA on AWS

Use the hook from the SAPHanaSR package. Optionally, you can copy it to your preferred directory; for example, /hana/share/myHooks. The hook must be available on all SAP HANA cluster nodes.

Stop the SAP HANA database, either with HDB or using sapcontrol, before proceeding further with changes, as shown in the following example.

hdbadm@prihana> sapcontrol -nr <instance_number> -function StopSystem

Update the global.ini file located at the /hana/shared/<SID>/global/hdb/custom/config/ directory on each node to enable the use of the hook script by both SAP HANA instances. Ensure that you make a copy/backup of global.inibefore updating the file.

[ha_dr_provider_SAPHanaSR]
provider = SAPHanaSR
path = /usr/share/SAPHanaSR
execution_order = 1

[trace]
ha_dr_saphanasr = info

The current version of the SAPHanaSR python hook uses the command sudo to allow the <sid>adm to access the cluster attributes. To enable this, edit and update the file /etc/sudoers as a root user with entries as shown in the following example:

# SAPHanaSR-ScaleUp entries for writing srHook cluster attribute
Cmnd_Alias SOK_SITEA = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_PRI -v SOK -t crm_config -s SAPHanaSR
Cmnd_Alias SFAIL_SITEA = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_PRI -v SFAIL -t crm_config -s SAPHanaSR
Cmnd_Alias SOK_SITEB = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_SEC -v SOK -t crm_config -s SAPHanaSR
Cmnd_Alias SFAIL_SITEB = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_SEC -v SFAIL -t crm_config -s SAPHanaSR
hdbadm ALL=(ALL) NOPASSWD: SOK_SITEA, SFAIL_SITEA, SOK_SITEB, SFAIL_SITEB
Note

hdb is the SAP HANA system ID used in the given example. You must replace hdb with lowercase SID of your SAP HANA installation. Replace the PRI and SEC references with your SAP HANA site names.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.