Running the new primary server in PRIMARY ALONE state
Although the connection to the secondary server is broken when the primary server is in the PRIMARY ALONE state, you can run a primary server with continuous updates to the transaction log. After the secondary server comes back up, the server in PRIMARY ALONE state can resume sending transactions to the secondary server.
There are three ways to set a server to PRIMARY ALONE state:
▪ Run the following command:
ADMIN COMMAND 'hotstandby set primary alone';
▪ Perform a controlled disconnect at either the primary or secondary server by using the following command:
ADMIN COMMAND 'hotstandby disconnect';
If you do a controlled shutdown by executing ADMIN COMMAND 'shutdown'; on the secondary server, the secondary server disconnects implicitly before shutting down, and the primary server switches to the PRIMARY ALONE state.
▪ Set the HotStandby.AutoPrimaryAlone parameter to yes (default value is no)
The server automatically switches to PRIMARY ALONE state when the connection to the secondary server is broken. Otherwise, after a server fails, the state of the server remains PRIMARY UNCERTAIN until the command ADMIN COMMAND 'hotstandby set primary alone' is run by the HAC, the administrator, or the watchdog program.
The PRIMARY ALONE state persists until one of the following situations occurs:
▪ A connection is successfully made to the secondary server.
▪ The server runs out of space for the transaction log.
▪ The log size limit (MaxLogSize) is reached.
▪ Another command switches the server to another state, such as STANDALONE.
▪ The primary server is shut down.
Important Do not shut down the primary server at the same time as switching the secondary server to PRIMARY ALONE state. The two operations are conflicting and might result in the secondary server switching to SECONDARY ALONE state instead. These two actions do not coincide in normal operation.
Also, even during the test phase, do not try to simulate primary server failure using shutdown because shutdown is no substitute for failure. Shutdown is a complex distributed operation that involves both primary and secondary servers. Also, after a shutdown the old primary server (that starts as a new secondary server) cannot catchup with the new primary server. To shut down a primary server, you should use the following sequence of tasks:
1 Perform the switchover.
2 Shut down the new secondary server.
The new primary server then switches automatically to the PRIMARY ALONE state.