After a restore succeeds, all restored tenants are standby tenants. You can execute the ACTIVATE STANDBY statement to convert a standby tenant into a primary tenant.
Background information
A tenant restored by using physical restore serves as a standby tenant. Subsequently, the tenant can provide services as a standby tenant or be converted into the primary tenant to provide services.
Prerequisites
Make sure that the restore has succeeded. For more information about how to view the restore result, see View the result of physical restore.
Convert a standby tenant into a primary tenant in the sys tenant
The sys tenant can convert a standby tenant in the system into a primary tenant.
Log in to the
systenant of the cluster as therootuser.Execute the following statement to perform the standby-to-primary switchover:
obclient [(none)]> ALTER SYSTEM ACTIVATE STANDBY TENANT tenant_name;Note
This statement allows you to switch only one tenant at a time. If you need to switch multiple tenants, execute this statement repeatedly.
Here is an example:
obclient [(none)]> ALTER SYSTEM ACTIVATE STANDBY TENANT mysql;For more information about the parameters in the statement, see Introduction to physical restore parameters.
Convert a standby tenant into a primary tenant in a user tenant
A user tenant can convert itself from a standby tenant into a primary tenant.
Log in to the database as the tenant administrator of a user tenant.
Note
The administrator user of a user tenant is the
rootuser.Execute the following statement to perform the standby-to-primary switchover:
obclient [(none)]> ALTER SYSTEM ACTIVATE STANDBY;