Unanswered: HADR takeover from standby server results in a error
Hi, I'm experiencing a problem testing hadr feature:
I've set up HADR on primary (X1) and standby (X2) servers.
Successfully have switched roles. Have tried to work with DB. Everything worked fine, but when I tried to switch roles again (to make X1 primary) i got an error message: "SQL1770N Takeover HADR cannot complete. Reason code = "4" (The command was issued against a standard or HADR primary database.)", however I am absolutely certain that I am issueing this on the standby machine.
So, could You help me, please, how to make X1 primary again.
P.S. TAKEOVER HADR ... BY FORCE ain't working also. (the same error)
Check to see the roles of the databases on both sides by doing a
db2 get db cfg for DBNAME| grep -i hadr
Check to see if replay is happening,
db2 list applications | grep -i db2replay (on standby)
On both sides run netstat to see if connection is established
netstat -a | grep -i hadr
db2 list utilities on standby should show the db in rollforward recovery.
db2pd -hadr -alldbs gives lot of details like loggapavg ... Also check the db2diag.log.
If hadr roles on both sides show as primary, then they are in splitbrain mode. You have t os ync them up and restart HADR.
Start HADR on standby and see. Activate the database on primary.
Otherwise try doing stop HADR on primary followed by standby and restart and try. If they are in splitbrain, each thinks its primary and u have to restart from the beginning.
Thank you for your help. The problem was that, I was trying to access standby database using Control Center and I was automatically rerouted to primary database, so I was unable to run the TAKEOVER BY FORCE command.