SAPHanaSR-showAttr(8)

πŸ“¦ version 1.3.4, in opensuse-leap 16.0

okay bestie, we’re doing SAPHanaSR-showAttr(8) from the SAPHanaSR manual today β€” yes, the whole cluster-attribute situation β€” and it’s giving very specific Unix realness. πŸ’…βœ¨

πŸ’– NAME πŸ’–

SAPHanaSR-showAttr β€” shows the Linux cluster attributes for a SAP HANA system replication setup. That’s the NAME section, but make it sparkle. πŸŽ€

✨ SYNOPSIS ✨

Bestie, here’s the exact shape of the thing, no cap:

SAPHanaSR-showAttr [--help | --version]
SAPHanaSR-showAttr [--cib CIB [...]]  [--sid SID] [--format FORMAT]
[--select COLUMN] [--sort SORT] [--properties PROPERTIES] [--from FROM]
[--to TO]
SAPHanaSR-replay-archive --dir DIR [--sid SID] [--format FORMAT]
[--select COLUMN] [--sort SORT] [--properties PROPERTIES] [--pattern PAT
[...]]  [--from FROM] [--to TO]

πŸ¦‹ DESCRIPTION πŸ¦‹

SAPHanaSR-showAttr shows Linux cluster attributes for SAP HANA system replication automation. The overall system replication (SR) state is shown, plus the HANA state on each node. Because the HANA srHook methods srConnectionChanged() and preTakeover() are used, that respective information shows up too. The info is fetched from the Linux cluster information base (CIB), not from HANA directly. And the fields you want to see can be specified by pre-defined selections via command line option. 🫢

The output shows four sections, containing all or some of the listed fields:

🌍 Global section 🌍

  • global (Global)
  • sequence number of record (cib-update)
  • maintenance status of Linux cluster (maintenance)
  • filter for resource agent logging (filter)
  • designated coordinater node id (dcid)
  • HANA primary replication site (prim)
  • HANA secondary replication site (sec)
  • HANA system identifier (sid)
  • HANA topology (topology)

🧱 Resources section 🧱

  • name of Linux cluster resources (Resources)
  • maintenance status of Linux cluster resources (maintenance)
  • promotability of Linux cluster clone resources (promotable)
  • target role of the Linux cluster resources (target-role)

🌸 Sites section 🌸

  • HANA site name (Sites)
  • SAPHanaSR last primary timestamp (lpt)
  • HANA landscape status (lss)
  • HANA current master nameserver for that site (mns)
  • HANA replication operation mode (opMode)
  • HANA system replication status from srConnectionChanged() (srHook)
  • HANA system replication mode (srMode)
  • HANA system replication status from RA monitor (srPoll)
  • HANA system replication role (srr)

πŸ–₯️ Hosts section πŸ–₯️

  • Linux hostname (Hosts)
  • state of the Linux cluster resource (clone_state)
  • actual and configured roles for HANA on that node (roles)
  • actual master score on that node (score)
  • HANA site where the host sits (site)
  • maintenance state of Linux cluster node (standby)
  • HANA system replication takeover action from preTakeover() (sra)
  • HANA system replication takeover action history (srah)
  • Linux cluster node fence status (terminate)
  • HANA version (version)
  • HANA virtual host name (vhost)

Some fields are generated dynamically from the CIB. Those fields are missing if no corresponding attribute exists, e.g. the standby field. An incomplete compilation on field details and purpose follows below. πŸ‘‡


🌍 Global β€” the string global

Value: global

The Global field is used as root for the whole data structure. The Global section shows overall information on the system. πŸ‘‘

πŸ–₯️ Hosts β€” Linux hostname

Value: [ HOSTNAME ]

These are hostnames of HANA nodes managed by the Linux cluster. The hostname has to follow UNIX RFC 1178. Additional rules specific to SAP apply. E.g. length of hostname is limited to 13 characters. See also the fields remoteHost and vhost. The Hosts section shows one line per host, containing details on that host and the HANA instance there. 🏠

🧱 Resources β€” name of Linux cluster resources

Value: [ RESOURCENAME ]

Name of the multi-state resource controlled by SAPHanaController, occasionally also the clone resource SAPHanaTopology or SAPHanaFilesystem. The Resources section shows the HANA cluster resources and their cluster maintenance attribute status. πŸ”§

🌸 Sites β€” HANA site

Value: [ HANA_SITE ]

The HANA sites are detected by SAPHanaTopology. Two sites are managed by the Linux cluster. Optionally a third site could be connected through multi-target system replication outside the cluster. The Sites section shows information on the sites known to the Linux cluster and the HANA system replication status. 🌐

πŸ”„ clone_state β€” clone state of the Linux cluster resource

Value: [ PROMOTED | DEMOTED | UNDEFINED | WAITING4LPA | WAITING4PRIM | WAITING4NODES | WAITING4REG ]

This variable is set by the SAPHanaController resource agent.

  • PROMOTED marks, on scale-up, the master state of an instance, which makes an HANA SR primary. On scale-out it indicates the master nameserver of the primary site.
  • DEMOTED makes, on scale-up, an HANA SR secondary. On scale-out all running nodes except the primary master nameserver are marked as DEMOTED. The DEMOTED state can be transient, on the way to promoting.
  • WAITING4LPA indicates potential risk of a dual primary situation. The cluster is waiting for DUPLICATE_PRIMARY_TIMEOUT seconds before registering the former HANA primary as new secondary.
  • WAITING4PRIM indicates the cluster is waiting for the HANA primary becoming ready in order to register the HANA secondary.
  • WAITING4NODES indicates, on scale-out, that not enough nodes are available to bring up a functional site, according to the HANA landscape configuration.
  • WAITING4REG indicates potential risk of a dual primary situation. The cluster is waiting for the administrator to manually register the former HANA primary as new secondary.

See also AUTOMATED_REGISTER and DUPLICATE_PRIMARY_TIMEOUT in ocf_suse_SAPHanaController(7). 🚨

πŸ› οΈ maintenance β€” maintenance status of Linux cluster or cluster resource

Value: [ true | false ]

This is a Linux cluster node attribute. It is set by an admin. The attribute is shown after it has been changed from the default. The field might appear or disappear, depending on cluster maintenance tasks. See also the standby attribute below. 🧰

βœ… promotable β€” promotability of Linux cluster clone resource

Value: [ true ]

This is a Linux cluster clone resource attribute. It is set as resource configuration meta attribute. The attribute is shown after it has been changed from the default. For the SAPHanaController multi-state clone resource this has to be "true". See also ocf_suse_SAPHanaController(7). πŸ‘‘

🎯 target-role β€” target role of the Linux cluster promotable clone resources

Value: [ started | disabled ]

Should the resource be started or stopped (disabled) by the Linux cluster. The attribute is shown after it has been changed from the default. The field might appear or disappear, depending on cluster maintenance tasks. 🎬

πŸ”Ž filter β€” SAPHanaController filter for logging

Value: [ filter ]

The filter is defined by hana_<sid>_glob_filter. See ocf_suse_SAPHanaController(7) for details. 🫧

⏱️ lpt β€” last primary timestamp

Value: [ UNIX_EPOCH | 30 | 20 | 10 | 0 ]

The node attribute lpa_<sid>_lpt or cluster attribute hana_<sid>_site_lpt_<site> is set by the SAPHanaController resource agent. When the RA detects a running HANA SR primary on the node, it records the Unix Epoch time. See the DUPLICATE_PRIMARY_TIMEOUT section of ocf_suse_SAPHanaController(7). Auxiliary values are set for an HANA SR secondary. 30 means the instance is evictable for primary. 10 means: not yet ready. ⏳

πŸ—ΊοΈ lss β€” landscape status

Value: [ 4 | 3 | 2 | 1 | 0 ]

The site attribute lss shows the return code of HANA’s landscapeHostConfiguration.py. The parameter does not tell you if the secondary system is ready for a takeover. The meaning is different from common Linux return codes. The SAPHanaController and SAPHanaTopology RAs will interpret return code 0 as FATAL, 1 as NOT-RUNNING (or ERROR) and return codes 2+3+4 as RUNNING.

  • 4 = OK β€” Everything looks perfect on HANA.
  • 3 = INFO β€” The landscape is completely functional, but the actual host role differs from the configured role.
  • 2 = WARNING β€” An internal HANA action is ongoing, e.g. host auto-failover.
  • 1 = DOWN β€” There are not enough active hosts.
  • 0 = FATAL β€” Internal script error, the state could not be determined.

See landscapeHostConfiguration.py and ocf_suse_SAPHanaController(7) too. 🧐

πŸ‘‘ mns β€” master nameserver

Value: [ HANA_MASTERNAMESERVER ]

The cluster attribute hana_<sid>_site_mns_<site> shows the current HANA master nameserver for the given site. It is empty for sites outside the Linux cluster. 🫑

🎭 srr β€” system replication role

Value: [ "P"rimary | "S"econdary | "N"one | "D"efect ]

The site attribute srr shows the current HANA system replication role for the given scale-out site. The attribute is set by the SAPHanaTopology resource agent. It is empty for sites outside the Linux cluster. πŸ’«

And there’s a Value: [ online | offline ] line sitting right here with no extra label attached, so we’re keeping it exactly as listed. 🫢

πŸ” opMode β€” HANA SR operations mode

Value: [ logreplay | delta_datashipping | logreplay_readaccess ]

The node attribute hana_<sid>_op_mode is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController resource agent for setting up system replication. delta_datashipping is not recommended in the context of Linux clusters. ⚠️

πŸ“‘ remoteHost β€” HANA SR remote host

Value: [ HOSTNAME ]

The node attribute hana_<sid>_remoteHost is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController resource agent for setting up system replication. See also the fields Hosts and vhost. πŸ›°οΈ

🎭 roles β€” actual and configured roles for HANA on that node

The roles field in the Hosts section has four sub-fields (A:B:C:D). For scale-up those four fields should be master1:master:worker:master. If a node leaves the cluster, the attribute gets lost. 😭

  • Field A: NameServer Config Role Value: [ master1 | master2 | master3 | worker | slave | standby | shtdown ]
  • Field B: NameServer Actual Role Value: [ master | slave | standby | shtdown ]
  • Field C: IndexServer Config Role Value: [ master1 | master2 | master3 | worker | slave | standby | shtdown ]
  • Field D: IndexServer Actual Role Value: [ master | worker | slave | standby | shtdown ]

πŸ† score β€” actual master score on that node

Value: [ 150 | 145 | 140 | 115 | 110 | 101 | 100 | 90 | 80 | 70 | 60 | 10 | 5 | 0 | -1 | -1234 | -5678 | -9000 | -10000 | -12200 | -22100 | -22200 | -32300 | -33333 | -INFINITY ] πŸ”₯

okay so picking right back up β€” score is a variable of the SAPHanaController resource agent, and it's calculated based on an internal scoring table. Here's the tea on the numbers:

  • 150 β€” this should cause the Linux cluster promoting the local resource instance to HANA SR primary master nameserver πŸ‘‘
  • 140 β€” a HANA primary master nameserver candidate
  • 100 β€” the HANA secondary master nameserver
  • -1234 β€” DR region nodes
  • this field should not be empty, bestie, fr fr
Note: the effective resource scoring used by the Linux cluster differs from the above values, because the cluster engine takes into account other factors as well. So don't @ me if the math looks off β€” it's the cluster's whole vibe.

πŸ“ sid β€” HANA system identifier

Value: [ SID ]

The SID is the same for the pair of HANA system replication databases in the Linux cluster. Also, an HANA database connected thru multi-target replication outside the cluster has this SID. Same SID, different situations, iykyk.

🌸 site β€” HANA site where the host sits

Value: [ HANA_SITE ]

The node attribute hana_<sid>_site is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController resource agent for setting up system replication. A dash (-) indicates the RA did not run or did not recognise the site. little dash of doom, basically.

πŸ¦‹ srMode β€” HANA SR mode

Value: [ sync | syncmem ]

The node attribute hana_<sid>_glob_srmode is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController resource agent for setting up system replication. SAP HANA knows also async and fullsync (see URLs below) β€” but those do not make sense for automating HANA system replication by a Linux cluster. Not every mode gets an invite to this party πŸ’…

πŸŽ€ standby β€” maintenance state of Linux cluster node

Value: [ on | off ]

This is a Linux cluster node attribute. It is set by an admin. The attribute is shown after it has been changed from the default. The field might appear or disappear, depending on cluster maintenance tasks. See also the maintenance attribute above. ghost attribute energy tbh πŸ‘»

⭐ srPoll β€” HANA SR status

Value: [ SOK | SFAIL | SWAIT | SREG | PRIM | DR ]

The cluster property hana_<sid>_site_srPoll_<site> is set by the SAPHanaController RA. The first three values are representing the HANA system replication status of a secondary. It is the value recognised at latest RA run, see ocf_suse_SAPHanaController(7) and systemReplicationStatus.py. The 4th value (PRIM) indicates an HANA SR primary. The 5th value (DR) indicates an HANA SR DR site. See SAPHanaSR_with_DR_HA(7) for details. ✨

🧚 sra β€” HANA system replication action

Value: [ T | R | F | - ]

The node attribute system replication action is checked by the HA/DR provider susTkOver.py using the API method preTakeover(). It is set by the SAPHanaController resource agent. It indicates whether a takeover or registration is ongoing. This attribute may not be persisted in pengine files. 🫠

  • T = Takeover on new primary (sr_takeover) ongoing.
  • R = Registration on new secondary (sr_register) ongoing.
  • F = Takeover failed.
  • - = No action pending.

πŸ’œ srah β€” HANA system replication action history

Value: [ T | R | F | - ]

The node attribute system replication action history stores actions in CIB attributes for later use, for root cause analysis. Same letters as above, but this one's the receipts β€” it remembers what happened so you can play detective later πŸ”

🌈 srHook β€” HANA replication channel state, indicated by srConnectionChanged

Value: [ SOK | SFAIL | SWAIT | SREG | PRIM ]

The cluster attributes related to srHook is hana_<sid>_site_srHook_<site>. It represents the HANA SR status from HA/DR provider API method srConnectionChanged(). See SAPHanaSR(7) and SAPHanaSR-ScaleOut(7) for supported API versions and scenarios.

The attribute is not updated if the cluster is not running. Thus, if the cluster is shut down while HANA remains running, the content of srHook might be outdated on cluster start until the next srConnectionChanged() event. See susHanaSR.py(7) and susHanaSrMultiTarget.py(7) for details. 😭

πŸ₯Ί terminate β€” Linux cluster node fence status

Value: [ true ]

Indicates whether that node is requested for being fenced from outside the Linux cluster. The attribute is removed as soon as the node has been successfully fenced. bye bestie, you're getting fenced πŸͺ“

πŸ“ version β€” HANA version

Value: [ HANA_VERSION ]

Version of the HANA instance on that node. Of course, should be supported for the given Linux version. Should be same on all nodes, except during specific HANA upgrade procedure. consistency is the whole vibe.

🌸 vhost β€” HANA virtual hostname

Value: [ HANA_VIRT_HOSTNAME ]

The virtual hostname is used by the HANA instance instead of the Linux hostname. The node attribute hana_<sid>_vhost is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController resource agent for setting up system replication. See also the fields Hosts and remoteHost. SAPHanaTopology needs the SAPHOSTAGENT to map from the local hostname to the HANA virtual hostname. name reveal, but for hosts πŸ’«


✨ OPTIONS ✨

  • --help β€” show help 🫢
  • --version β€” show version
  • --cib CIB [CIB [...]] β€” read data from given offline cib or pe-file(s) (alteranative to --dir β€” and yes bestie, that typo is canon, I don't make the rules πŸ’€)
  • --dir DIR β€” specify the directory where to search for pe-files (alternative to --cib)
  • --format [ script | tables | json | tester | csv | cache ] β€” output format, default is tables
  • --experiemental_fields SECTION:FIELD[,FIELD[,...]] β€” define which fields a section should show, experimental
  • --from "YYYY-MM-DD HH:MM:SS" β€” from which point in time to show ⏰
  • --pattern PAT [PAT [...]] β€” pe-file name pattern to search for in DIR, default pe-input-[0-9].*xz2
  • --properties PROPERTIES β€” specify a properties file, see also SAPHanaSR-showAttr_properties(5)
  • --select [ all | default | minimal | sr | cluster | cluster2 | cluster3 | sitelist | tester ] β€” show selected information only, default is default
  • --sid SID β€” use SAP system ID SID. Should be autodetected, if there is only one SAP HANA instance installed on the local cluster node. The SAP system ID is a 3 alphanum string with a valid SAP system name like SLE, HAE, FH1, C11, or P42.
  • --sort [ host | roles | site ] β€” specify the Host section column name to sort by, default is host
  • --to "YYYY-MM-DD HH:MM:SS" β€” to which point in time to show

πŸ’– RETURN CODES πŸ’–

  • 0 β€” Successful program execution. slay βœ…
  • >0 β€” Usage, syntax or execution errors. not slay 😭

πŸŽ€ EXAMPLES πŸŽ€

show all the things

# SAPHanaSR-showAttr

Show all SAPHanaSR attributes and relevant cluster maintenance states.

If the roles sub-fields are ::::, landscapeHostConfiguration.py has not been able to detect the HANA roles during last recent RA monitor operation. Likely HANA was down or sudo <sid>adm failed. πŸ”

sorted by roles

# SAPHanaSR-showAttr --sort roles

Show all SAPHanaSR attributes in the cluster and sort host table output by roles.

from a cib file

# SAPHanaSR-showAttr --sid HA1 --cib ./hb_report-17-07-2019/grauenstein01/cib.xml

Show all SAPHanaSR attributes for SAP System ID HA1 and instance number 10 from given CIB file.

the score grep

# SAPHanaSR-showAttr | grep -e master: -e worker: -e slave:

Show SAPHanaSR promotion scores on running nodes. πŸ‘‘

the watch loop

# watch -n9 "crm_mon -1r --include=none,nodes,resources,failures;echo; \
    SAPHanaSR-showAttr;cs_clusterstate -i|grep -v '#'"

Display comprehensive overview on Linux cluster and HANA resources, update every nine seconds. main character dashboard energy πŸ”₯


πŸ¦‹ FILES πŸ¦‹

  • /usr/bin/SAPHanaSR-showAttr β€” the program itself.
  • /usr/lib/SAPHanaSR-angi/ β€” needed libraries.
  • /usr/sap/hostctrl/exe/saphostctrl β€” the SAP host control command.

⭐ REQUIREMENTS ⭐

  • Python 3.6 runtime environment or compatible.
  • Attribute names shall not contain the underscore "_", except attribute name "clone_state". one exception, and it's iconic πŸ’…

πŸ™ˆ BUGS πŸ™ˆ

Formatting and content of this script's output will change, since this script is under development. (it's giving "work in progress, be nice to her") πŸ’€

In case of any problem, please use your favourite SAP support process to open a request for the component BC-OP-LNX-SUSE. Please report any other feedback and suggestions to feedback@suse.com. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

SAPHanaSR-showAttr_properties(5), ocf_suse_SAPHanaController(7), ocf_suse_SAPHanaTopology(7), SAPHanaSR-ScaleOut(7), SAPHanaSR(7), SAPHanaSR-angi(7), SAPHanaSR-replay-archive(8), SAPHanaSR_maintenance_examples(7), SAPHanaSR-manageAttr(8), crm_simulate(8), crm_report(8), cibadmin(8), crm_mon(8), crm_attribute(8), cs_convert_time(8), cs_clusterstate(8), cs_show_hana_info(8), cs_show_scores(8),

https://documentation.suse.com/sbp/sap/, https://documentation.suse.com/sles-sap/, https://www.susecon.com/archive-2020.html 🌈


🌸 AUTHORS 🌸

A.Briel, F.Herschel, L.Pinne. the founding mothers/fathers of this whole situation 🫢


  • (c) 2014 SUSE Linux Products GmbH, Germany.
  • (c) 2015-2017 SUSE Linux GmbH, Germany.
  • (c) 2018-2026 SUSE LLC

SAPHanaSR-showAttr comes with ABSOLUTELY NO WARRANTY. For details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html


and that's the whole page bestie!! πŸ’–βœ¨ this lil' beauty is dated 17 Feb 2026 and lives at SAPHanaSR-showAttr(8) in the manual β€” go forth and read your attributes, you absolute icon πŸ‘‘πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from