lib/sles4sap/database_hana.pm

SYNOPSIS

Package contains functions for interacting with hana database and related actions.

hdb_stop

hdb_stop(instance_id=>'00', [switch_user=>'sidadm', command=>'kill']);

Stop hana database using HDB stop command. Function expects to be executed as sidadm, however you can use switch_user to execute command using sudo su - as a different user. The user needs to have correct permissions for performing requested action. Function waits till all DB processes are stopped.

wait_for_failed_resources

wait_for_failed_resources();

Wait until 'crm_mon' starts showing failed resources. This can be used as first indicator of a started failover.

wait_for_takeover

wait_for_takeover(target_node=>'expeliarmus');

Waits until target_node performs takeover and reaches 'PRIM' state.

register_replica

register_replica(target_hostname=>'Dumbledore', instance_id=>'00' [, switch_user=>'hdbadm']);

Executes replica node registration after failover using 'hdbnsutil' command. Node must be stopped, otherwise command fails.

get_node_roles

get_node_roles();

Returns HASHREF containing current status of Hana cluster node roles by parsing 'SAPHanaSR-showAttr' output. Example: {primary_node=>'Harry', failover_node='Potter'}

check_node_roles

check_node_roles(expected_primary=>'Albus', expected_failover=>'Dumbledore');

Checks if expected node roles match current node order. Returns if roles match, otherwise test dies.

find_hana_resource_name

find_hana_resource_name();

Finds SAP Hana primitive resource name by listing primitives with type 'ocf:suse:SAPHana'.