SAP HANA Distributed System Replication setup, operations and associated HANA Monitoring of Disaster Recovery (DR) scenario using OZSOFT HANA Management Pack for SCOM
How to submit a standout Adobe Champion Application
SAP HANA System Replication - Setup, Operations and HANA Monitoring
1. SAP HANA Distributed System -
System Replication and DR
Diagram courtesy SAP SE
By OZSoft Consulting for ITConductor.com
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 1
2. Introduction
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 2
This presentation is a collection of notes taken while
configuring the System Replication (SR). It also includes:
• Notes taken while setting up multiple hosts and dynamic
tiering, in relation to system replication.
• Monitoring guides/notes and SAP-provided SQL monitoring
queries
• OZSOFT’s HANA Management Pack for SCOM Replication
Health Monitoring
System Replication is part of HANA’s high availability facility,
and also allows no business downtime when upgrading the
HANA server database.
3. References
For detailed steps in configuring the System Replication, refer
to the following:
Scale Out:
• http://www.itconductor.com/blog/sap-hana-distributed-
system-practical-guide-to-scale-out-ha-and-monitor-hana
System Replication:
• How to Perform System Replication for SAP HANA
• SAP HANA Administration Guide
Note – always download the latest version of the guide
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 3
4. Configuration / Setup (1)
• For complete list of prerequisites, refer to SAP HANA
Administration Guide
• A recent database backup should be created prior to starting
the set-up. For MDC, this include both system DB and tenant
database(s)
• Before starting the setup, review the following and decide
on an option to take. Refer to the Administration Guide.
- Synchronization mode options (sync | syncmem | async)
- Operation mode options (delta_datashipping | logreplay)
• Refer to the Administration guide on SR-related
configuration parameters
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 4
5. Configuration / Setup (2)
SR can be setup by the command line “hdbnsutil” or HANA Studio
Scenario – Dbname=HDB, instance number=00
• ozhanaitc as the primary system
• ozhdbdr1 as the secondary system
Command line used:
1. Enable SR, from primary system ozhanaitc
‘hdbnsutil -sr_enable -name=ozhanaitc’
2. Stop the secondary system using sapcontrol. From ozhdbdr1
‘sapcontrol -nr 00 -function StopSystem HDB’
3. Register the secondary system, from ozhdbdr1
‘hdbnsutil -sr_register -remoteHost=ozhanaitc -remoteInstance=00 -
mode=sync -name=ozhdbdr1’
4. Start the secondary system using sapcontrol. From ozhdbdr1
‘sapcontrol -nr 00 -function StartSystem HDB’
Once ozhdbdr1 is started, the replication process will start.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 5
6. Additional notes
• When setting the system replication (SR), recommend to use the physical
host name as the logical name/alias
• When using the “hdbnsutil” command to register the secondary system,
the mode syntax is ‘mode=xx’, not ‘replicationMode=xx’
• SR will overwrite the entire contents of the secondary system – this will
include all DB users. The password of the SYSTEM user in the secondary
system will be changed to the one in primary system
• When the SR is active
• The secondary system cannot be accessed on its application
interfaces, e.g. SQL port.
• Communication between primary and secondary system happens on
a set of ports reserved for SR
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 6
7. System Replication – status (1)
Viewing status of SR from HANA Studio
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 7
Ports
30,001 = systemDB
30040 and 30043 – for tenant DB
8. System Replication – status (2)
The main source of monitoring system replication is via view
M_SERVICE_REPLICATION. Click the link to get the columns
and description.
Replication STATUS from view M_SERVICE_REPLICATION.
Refer to the Administration Guide for graph/flow on the
status.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 8
9. Multiple Hosts (1)
• Prerequisite for distributed systems (i.e. multiple hosts) -
there should be matching ’worker’ hosts between the
primary and secondary systems.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 9
Primary system
ozhanaitc – primary host
ozhdbnode2 – standby host
ozhdbnode3 – worker host
Secondary System
ozhdbdr1 – secondary host
ozhdbdr3 – worker host
• Refer to HANA Administration Guide, section ‘Configuring Host Name
Resolution for SAP HANA System Replication’
• (Extract from SAP HANA Admin Guide) – ‘Implied – standby host on the
primary system need not be available on the secondary system.’
10. Multiple Hosts (2)
• If there is a primary host without a matching secondary host,
the data from the unmatched host will not be available after
a takeover.
• System Replication detects all the nodes of a multiple-host
system
• Up to SPS12, Dynamic Tiering hosts is not supported in the
System Replication.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 10
11. Multiple Hosts (3) – SR status from OS
If there is not a one-to-one host mapping.
• In the primary host (ozhanaitc), ‘not mapped’ is displayed.
• In the secondary host (ozhdbdr1), all primary hosts are
displayed
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 11
12. Multiple Hosts (4) – SR Status from HANA Studio
SR status display from HANA Studio
• The status will be green if each/all nodes in the primary
system with data has a matching host in the secondary
system
• The status will be ‘yellow’ if there is a host in the primary
with data that has no mapped host in the secondary system.
Unmapped host will have ‘Secondary_Host=Not mapped’
and ’Replication_Status=Unknown’.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 12
13. Disabling / Clean-up
There maybe a situation that the SR need to be disabled.
Briefly, required steps below, via HANA Studio or command
line “hdbnsutil”
• Stopping the secondary system
• Unregister the secondary system
• Disable the system replication from the primary system
Some issue encountered during ‘disabling/cleanup’
• In one case, doing the above steps does not properly ‘clean’ the SR entries, and a
‘hdbnsutil -sr_cleanup’ is needed.
• In one case, after trying to re-register the secondary system after a cleanup, the
process went into unending loop, used all the CPU, and kept increasing the log
storage. The action taken was to delete the data and log directories of the
secondary system.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 13
14. Standard System Replication Alerts
Reference: from SAP portal help System Replication Alerts
ID 78 - connection between systems in system replication closed
• Identifies close connection status between the primary and secondary
system. When this alert is raised, the replication is not happening.
• Alert rating = 4, check of frequency – 5 minutes
ID 79 - Configuration consistency of systems in system replication setup
• Identifies configuration parameter that is not consistent between the
primary and secondary system. It is important that both system have the
same parameter and values in case of takeover.
• Alert rating = 2, check of frequency – 2 minutes
Note that it is not possible to change the configuration parameter of the
secondary system through HANA Studio – need to edit it directly in the OS
side
There is a parameter to exclude checks on some parameter
There is a parameter to automatically synchronize parameters of the
secondary from the primary.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 14
15. Monitoring from HANA Studio
Overview Status
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 15
Note that the status is green even if some tenants are not active/stopped
The main source of the display is from table M_SERVICE_REPLICATION
Tenant DB that is stopped will not be replicated. Only after it is started and
a backup created that system replication will start
16. Monitoring – using SQL and SR view
• Public view M_SERVICE_REPLICATION contains all
information about replication services
• SAP-provided SQL queries
1969700 - SQL Statement Collection for SAP HANA – this
contain SQL collection, which include SR-related queries,
below
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 16
Check ID Details
1810 Services with replication error
1811 Services with unknown replication state
1813 Replication connection closed (last day)
1815 Current log shipping delay (s)
1816 Filling level of async shipping buffer (%)
1820 Parameter deviations primary vs. secondary site
1830 Age of oldest replication snapshot (h
19. Monitoring – SQL (3)
SQL equivalent to Alert 78
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 19
SQL CheckID 1811 – Services with unknown replication state
20. Monitoring – SQL (4)
SQL report on severity of log shipping delay
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 20
21. OZSOFT HANA MP Dashboard - Replication Health (1)
OZSOFT HANA Management Pack for SCOM:
Dashboard, derived from M_SERVICE_REPLICATION
- Replication status
- Log Backlog
- Log Shipped Delta Size (in MB)
- Alerts
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 21
22. OZSOFT HANA MP Dashboard - Replication Health (2)
Status
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 22
23. OZSOFT HANA MP Dashboard - Replication Health (3)
In each dashboard, personalization is allowed to control
information displayed
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 23
24. Additional Documents
OSS notes
• 1999880 - FAQ: SAP HANA System Replication
• 2063657 - HANA System Replication takeover decision
guideline
• 2165547 - FAQ: SAP HANA Database Backup & Recovery in
an SAP HANA System Replication Landscape
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 24
25. What’s next
Topics for future blogs
- SAP HANA dynamic tiering – to include set-up, extended
storage, tenant database data provisioning, table definition
with extended storage, backup.
Author: Terry Kempis
Editor: Linh Nguyen
ITConductor.com 25
26. • Any Questions?
• Contact Info:
Linh Nguyen linh.nguyen@itconductor.com
Terry Kempis terry.kempis@itconductor.com
Let
itconductor.com
@itconductor