Skip to content

USE CLUSTER

Set the cluster to use for queries and other database operations.

USE CLUSTER name

If the cluster name includes special characters, use double quotes around the name.

See also ALTER USER SET DEFAULT_CLUSTER.

For example, return the list of available clusters, then set the cluster:

yellowbrick=# select * from sys.cluster;
-[ RECORD 1 ]-------------+-------------------------------------
cluster_id                | 9068c6c5-7d09-4091-b8a9-8978f62cc970
cluster_name              | uat-rc5-cluster-01
nodes                     | 1
default_wlm_profile_name  | default
active_wlm_profile_name   | default
hardware_instance_type_id | b7da0afd-2c98-4f57-888d-98a51975a412
hardware_instance_name    | large-v1
is_default_cluster        | t
auto_suspend              | 300
auto_resume               | t
max_spill_pct             | 30
max_cache_pct             | 70
type                      | COMPUTE
state                     | RUNNING
-[ RECORD 2 ]-------------+-------------------------------------
cluster_id                | c1fab7bc-c24e-4aa2-9217-c21f414dd020
cluster_name              | bobr-rc5-april4-cluster
nodes                     | 2
default_wlm_profile_name  | default
active_wlm_profile_name   | default
hardware_instance_type_id | f43d64aa-828e-42cc-b402-60e008c544a3
hardware_instance_name    | small-v1
is_default_cluster        | f
auto_suspend              | 300
auto_resume               | t
max_spill_pct             | 30
max_cache_pct             | 70
type                      | COMPUTE
state                     | SUSPENDED

yellowbrick=# use cluster "bobr-rc5-april4-cluster";
SET