ACTIVATE STANDBY
Description
ALTER SYSTEM ACTIVATE STANDBY activates the current standby online as a new primary when the original primary is unavailable. Data that has not been synchronized to the standby cannot be recovered, so this operation can cause data loss.
Before execution, isolate the original primary and verify that it cannot resume write services.
Privilege requirements
The current user must have the ALTER SYSTEM privilege. For more information, see Privilege classification.
Syntax
ALTER SYSTEM ACTIVATE STANDBY [VERIFY];
Parameters
| Parameter | Description |
|---|---|
VERIFY | Checks whether the current standby meets the activation conditions without changing its role. A successful check does not guarantee that the subsequent operation will succeed. |
Example
ALTER SYSTEM ACTIVATE STANDBY VERIFY;
ALTER SYSTEM ACTIVATE STANDBY;
SELECT ROLE, SYNC_SCN, READABLE_SCN
FROM oceanbase.V$OB_SERVER_STAT;
After activation succeeds, ROLE is PRIMARY. Then update application connections and the upstream relationships of other standbys, and keep the original primary isolated.
For the complete procedure, see Switch roles.