Skip to Content
Author's profile photo Steve Soumah

SAP HANA Hands on tests ( part 4.1 ) : HANA replication takeover


In a previous document / blog , I performed the replication setup of my HANA test db.

My layout is described by this diagram. in this first attempt, the replication is perfomed @ HDB level ( not at the disks level, i’ll probably give it a try later ) :


My first HANA system sits in DC1 ( hdbtest1 ) the second is in DC2 ( hdbtest2 ).

What i did so far was :

  • Install the HDB node 1
  • Install an ECC EHP7 on top of it
  • Build a stdby node
  • Replicate to HDB node 2

In my test set up , I do not have the nice network layer and HA solution that would allow me to switch from one DC to another with minimum downtime.

I will perform this switch manually ( mainly by re-configuring the ECC application server to point on hdbtest2 instead of hdbtest1 as a db server and modifying the hdbuserstore “DEFAULT” key ) .

So, in fact, my ECC server will still work from DC1, while the HDB will be available in DC2.

The hana takeover can be done using the HDB studio or the command line tool “hdbnsutil”.

When it comes to DR scenario, I like to consider nothing works as it should, so let’s pretend the HDBStudio does not work and use the hdbnsutil command line huh !

Generate some load on the HDB

I’m running SGEN on the ECC platform in order to generate some load on the system :



and I can see in some HDB log files that things are being replicated :

on hdbtest1 ( PRIM ) :


on hdbtest2 ( STBY ) :


Now let’ s “crash the system ” !!


Ouch … This one was nasty :

As of now, the primary DB is down, the standby is still in standby mode.


The ECC server lost the DB :


The stby HDB lost contact of the primary one :



Let’ s perform the HANA takeover :

    • Connect to the STBY ( surviving ) host .
    • Use the <hdb>adm user.
    • Trigger the takeover :

hdbnsutil -sr_takeover ( Easy )

looking at the logs on the stby hosts, we can see the takeover progress :



The HDB is back online in a few minutes on node 2 in DC2 :


Now I have to stop and reconfigure my ECC server ( this is due to my test infra layout ) .

In this kind of layout I had to modify the DEFAULT entry in mt <sid>adm hdb userstore :

hdbuserstore SET DEFAULT “hdbtest1:30015;hdbtest2:30015” SAPHEC1 <password>

Restart my ECC instance. Et Voilà !

The system is back online with the hana DB working in DC2 on node 2.

Let’s reconnect and keep going with the SGEN :



Everything worked.

Next step : failback !

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Nicholas Chang
      Nicholas Chang


      Just my 2 cents worth, you don't need to change the hdbuserstore if you use "system_replication_hostname_resolution" in both primary and secondary hdb. You just need to map DNS on SAP instance whenever there's a takeover.


      Nicholas Chang

      Author's profile photo Steve SOUMAH
      Steve SOUMAH
      Blog Post Author

      Hi Nicholas,

      Thanks for this info.

      I'll have a look at it. I'm currently playing with the HANA recommended network setups on my tests machines.

      Thanks again & BR.


      Author's profile photo Former Member
      Former Member

      Hi Steve,

      Thanks for sharing your blog. I have a similar situation where I would like to connect our ERP EHP7 app servers on microsoft cluster to secondary hana DR site incase we failover to secondary. I couldnt find any information on this and not sure if userstore will help. Appreciate if you can provide any inputs or any documents on this.