Forces the current tenant primary to switch roles with the tenant mirror.
CALL DBCloud.FailoverToMirror ( database=database )
dbcloudcmd run FailoverToMirror database
The tenant database. Accepts a search query that identifies one database, for example a database name or ID. (Required)
Initiating failover forces the tenant mirroring partners to change their roles without stopping the cloud servers. The primary (that has ownership of the read-write copy of the database) becomes the mirror. The mirror becomes the primary, and its database becomes the read-write copy.
FailoverToMirror results in restarting the tenant database. This task can complete before the database is restarted.
The primary database stops and restarts as the mirror database, resulting in dropped connections. Connections to the mirror database that becomes the primary database and scale-out database copies are not affected.
To stop or drop the primary database without stopping or dropping the tenant database, you must first use the FailoverToMirror task to make the primary the mirror. You can then convert the mirror to a scale-out database copy and stop or drop it.
Run the following task to force the primary and mirror databases for the tenant database my_db to switch roles:
dbcloudcmd run FailoverToMirror my_db