Data Section ContentsDescriptionTextReturn
Code
See data description
above.
The request has succeeded,
but this is only one response
in many.
PARTIAL_SUCCESS
1016
Switchover
The switchover command causes the two PDBAs to switch Active/Standby status. By default, the
command works like a toggle switch. The PDBA receiving the request changes its status from Active
to Standby or from Standby to Active and informs the other PDBA to do the opposite.The side
parameter in the request specifies the desired status for the receiving PDBA. If this parameter is used,
the receiving PDBA attempts to set itself to the requested status and tells the mate PDBA to set itself
to the opposite status. If the two PDBAs are already in the desired states, no action is taken.
Because the goal of the switchover command is to change the Active/Standby status of the PDBA,
and because write transactions can be done only on the Active PDBA, it is a requirement that no write
transactions be active for a switchover to be performed. It is also a requirement that all asynchronous
replication be completed before the switchover is permitted.
The switchover command has a timeout parameter (similar to the begin_txn command) to allow
the command to wait for any existing write transactions to complete. If the switchover command
is being sent to the standby side and the active side has a write transaction that was left open, sending
the switchover command with the force parameter set to yes overrides the open write transaction;
it also allows the switchover to occur. While this behavior is permitted, it is extremely dangerous to
steal the write transaction from an active client.
If the write transaction is truly hung for whatever reason, it is much safer to stop and restart the
PDBA that has the write transaction hung. If the switchover command is being sent to the active
side while another client has the write transaction open, the switchover is unsuccessful with
WRITE_UNAVAIL, even if the force option is used. The force option is also ignored if the databases
are not yet synchronized.
By default, if a PDBA application receives a switchover request but the PDBA is unable to
communicate with its mate PDBA, the request fails. An optional force parameter can be used to
cause the receiving PDBA to ignore the fact that it cannot communicate with its mate and perform the
switchover anyway. This option can be useful if communication between the two PDBAs has been
broken, but the PDBA that was previously Standby needs to become Active.
Use the switchover command very carefully. It is possible to use this command in such a way that
causes the two PDBs to be out of synch. When the PDBAs are successfully communicating, changing
the Active/Standby status of either PDBA causes the other PDBA to change as well. However, if the
two PDBAs are unable to communicate, then a switchover command received by one of them fails
because it cannot inform the mate that a switchover is taking place. This failure ensures that both
PDBAs do not think that they are the Active PDBA.
If the force parameter is used and both PDBAs become Active, it is the client’s responsibility to
ensure that they are not both written to.
If updates are sent to both PDBs while they are not communicating with each other, the databases can
become irreversibly out of synch. When the PDBAs see each other again, they detect the synchronization
problem and force both PDBAs to be in Standby mode. Any attempt to switchover either PDBA to be
111
910-6022-001 Revision A, March 2011
PDBI Request/Response MessagesProvisioning Database Interface Manual