Many people asked me what the correct order is when using hdbnsutil commands in the context of system replication.
If you have no clue what I am talking about you might want to press ALT+F4 or have a look into following how-to guide:
How to Perform System Replication for SAP HANA
Let me try to make it as clear as crystal...while keeping it simple.
ENVIRONMENT
A=first and preferred data center
B=second data center
PRIM=HANA system which acts as primary in system replication mode
SEC=HANA system which acts as secondary in system replication mode
INITIAL SETUP TO ENABLE SYSTEM REPLICATION BETWEEN A AND B
A> hdbnsutil -sr_enable --name=SITEA (HANA system started, A=PRIM)
B> hdbnsutil -sr_register --name=SITEB --… (HANA system stopped, B=SEC)
B> HDB start (system replication will start when B is completely started)
DISASTER IN A OCCURS
B> hdbnsutil -sr_takeover (B=PRIM)
now recovery of A is performed and when done next step
A> hdbnsutil -sr_register --name=SITEA --… (HANA system stopped, A=SEC)
A> HDB start (system replication will start when A is completely started, HANA will determine if a complete sync is necessary or a delta will do)
FAIL BACK
Now A=SEC B=PRIM and systems are in sync. You might want to fail back to the original setup A=PRIM and B=SEC for various reasons
A> hdbnsutil -sr_takeover (HANA system started, A=PRIM)
B> HDB stop
B> hdbnsutil -sr_register --name=SITEB --… (HANA system stopped, B=SEC)
B> HDB start (system replication will start when B is completely started)
yes, this is the only way to fail back, also if you ask me 10 more times ;-)
SIDE STORY: DISASTER IN B OCCURS WHILE B IS SEC
Not much to do, once B is recovered and restarted system replication will re-sync
Happy XMAS and bye for now,
Frank
PS: Executing this commands in the wrong order might lead into a HANA system which does not start anymore. So be careful! And I know what I am talking about after searching for hours to find the root cause and then figuring out it was created by myself.