This feature is in preview. This feature is subject to change. To share feedback and/or issues, contact Support.
This is an enterprise-only feature. Request a 30-day trial license to try it out.
New in v23.2:
The ALTER VIRTUAL CLUSTER
statement initiates a cutover in a physical cluster replication job and manages a virtual cluster.
Physical cluster replication happens between an active primary cluster and a passive standby cluster that accepts updates from the primary cluster. The unit of replication is a virtual cluster, which is part of the underlying infrastructure in the primary and standby clusters. Each cluster has:
- The system interface manages the cluster's control plane and the replication of the virtual cluster.
- The virtual cluster manages its own data plane. Users connect to the virtual cluster that contains the application user data.
For more detail, refer to the Physical Cluster Replication Overview.
Required privileges
ALTER VIRTUAL CLUSTER
requires one of the following privileges:
- The
admin
role. - The
MANAGEVIRTUALCLUSTER
system privilege allows the user to run all the relatedVIRTUAL CLUSTER
SQL statements for physical cluster replication.
Use the GRANT SYSTEM
statement:
GRANT SYSTEM MANAGEVIRTUALCLUSTER TO user;
Synopsis
Parameters
Parameter | Description |
---|---|
virtual_cluster_spec |
The virtual cluster's name. |
PAUSE REPLICATION |
Pause the replication stream. |
RESUME REPLICATION |
Resume the replication stream. |
COMPLETE REPLICATION TO |
Set the time to complete the replication. Use:
|
SET REPLICATION RETENTION = duration |
Change the duration of the retention window that will control how far in the past you can cut over to. We do not recommend setting RETENTION much higher than the 24-hour default on the standby cluster. Accumulated data from an excessive retention (cutover) window could affect queries running on the standby cluster that is active following a cutover. |
GRANT ALL CAPABILITIES |
Grant the virtual cluster all capabilities. |
REVOKE ALL CAPABILITIES |
Revoke all capabilities from the virtual cluster. |
GRANT CAPABILITY virtual_cluster_capability_list |
Specify a capability to grant to the virtual cluster. |
REVOKE CAPABILITY virtual_cluster_capability_list |
Revoke a capability from the virtual cluster. |
RENAME TO virtual_cluster_spec |
Rename a virtual cluster. |
START SERVICE SHARED |
Start the virtual cluster. That is, start the standby's virtual cluster so it is ready to accept SQL connections after cutover. |
STOP SERVICE |
Stop the shared service for the virtual cluster. Note that the virtual cluster's data_state will remain as ready for the service to be started once again. |
Examples
Start the cutover process
To start the cutover process, use COMPLETE REPLICATION
and provide the timestamp to restore as of:
ALTER VIRTUAL CLUSTER application COMPLETE REPLICATION TO {cutover time specification};
You can use either:
SYSTEM TIME
to specify a timestamp.LATEST
to specify the most recent replicated timestamp.
Set a retention window
You can change the retention window to protect data from garbage collection. The retention window controls how far in the past you can cut over to:
ALTER VIRTUAL CLUSTER application SET REPLICATION RETENTION = '24h';
We do not recommend setting RETENTION
much higher than the 24-hour default on the standby cluster. Accumulated data from an excessive retention (cutover) window could affect queries running on the standby cluster that is active following a cutover.
Start the virtual cluster
When a virtual cluster is ready
after initiating the cutover process, you must start the service so that the virtual cluster is ready to accept SQL connections:
ALTER VIRTUAL CLUSTER application START SHARED SERVICE;
To stop the shared
service for a virtual cluster and prevent it from accepting SQL connections:
ALTER VIRTUAL CLUSTER application STOP SERVICE;