Manual Takeover SAP HANA System Replication.
Manual Takeover SAP HANA System Replication.
Prerequisites
• SID/Instance: SHQ / 40
• Host: systemdb (10.255.16.124)
• Site Name: DC1
• SID/Instance: SHQ / 40
• Host: hanatest (10.255.7.195)
• Site Name: DC2
• IP: 10.255.16.121
• SAP connects to the HANA system via systemdb (10.255.16.124)
Objective
Perform a HANA system replication takeover from the current Primary (10.255.16.124) to the Secondary
(10.255.7.195) and redirect the Windows-based SAP application to the new primary database.
Navigate to:
C:\Windows\System32\drivers\etc\hosts
10.255.7.195 systemdb
10.255.16.124 systemdb
When you trigger a takeover, hanatest (10.255.7.195) becomes the new primary. But SAP-app Server currently
connects to the old IP (10.255.16.121)
Verify: Ensure Primary Host Mappings are updated to point to the Secondary systemdb → [DC2] hanatest before
the takeover.
Kashif
Kashif
Verify: Currently, the SAP application connects to the HANA system via the hostname “systemdb”, which resolves to
the IP 10.255.16.124—the current Primary database host.
Verify: Secondary Host Mappings are correctly so that the host “systemdb” and associated with [DC1]
Kashif
2. Initiate Takeover from Secondary Database
hdbnsutil -sr_takeover --suspendPrimary --maxWriteTransactionWaitTime=500
✅ This command suspends the current primary and promotes the secondary as the new primary.
Kashif
3. Register the Old Primary as the New Secondary
# Stop HANA
HDB stop
# Register as Secondary
# Start HANA
HDB start
✅ This converts the previous primary to as the new secondary, enabling replication from hanatest.
Verify: On the new Primary database (hanatest), confirm that system replication is active and correctly replicating
to the new Secondary (systemdb).
Python systemReplicationStatus.py
Replication status shows ACTIVE and the roles reflect hanatest as Primary and systemdb as Secondary.
Kashif
5. Restart SAP Services
Restart the SAP services from SAP Management Console (SAP MMC).
After that login SAS GUI and Run DB02 T-code to verify the primary successfully have takeover
Know New primary successfully has been takeover look the DB02 to screen SAP GUI running hanatest(10.255.7.195)
Kashif
✅ Successful takeover is confirmed when DB02 reflects hanatest as the connected database host.
Kashif
Conclusion
The system has successfully performed a takeover from the old primary (10.255.16.124) to the new
primary (10.255.7.195). All configurations including host mappings and system registration have been
updated accordingly.
Kashif