Skip to content

ALTER CLUSTER

Alter the attributes or state of an existing cluster, using one or more WITH() options. You can also suspend, resume, or rename a cluster.

ALTER [ COMPUTE ] CLUSTER name
WITH (
[ NODE_COUNT number ]
[ AUTO_SUSPEND number | NULL ]
[ AUTO_RESUME TRUE | FALSE ]
[ WLM_PROFILE name ]
)
[ ACTIVATE wait_seconds [ WITH CANCEL | WITHOUT CANCEL ] ]
ALTER [ COMPUTE ] CLUSTER name
[ SUSPEND | SUSPEND wait_seconds [ WITH CANCEL | WITHOUT CANCEL ] ]
[ RESUME 
[ RENAME TO new_name ]
COMPUTE
Optional keyword; in the current release, all clusters are compute clusters. They do the work of executing queries and other operations such as bulk loads.
name
Unique name for a cluster within an instance.
NODE_COUNT
The number of worker nodes assigned to the cluster.
AUTO_SUSPEND
The number of seconds of user inactivity, after which the cluster is automatically suspended.
AUTO_RESUME
Whether to automatically resume the instance when a new user query is submitted against a suspended cluster.
WLM_PROFILE
WLM (workload management) profile associated with the cluster. A default profile is assigned when a cluster is created.
ACTIVATE wait_seconds
The number of seconds to wait before activating the modified cluster, with or without cancelling queries that are currently running.
SUSPEND
Suspend a running cluster. Optionally, specify a wait time and whether to cancel running queries.
RESUME
Resume a suspended cluster.
RENAME TO
Rename a cluster.

Examples with Modified Attributes

The following example alters a compute cluster called large-default-cluster, giving it two nodes and automatic suspension after 600 seconds of inactivity:

premdb=> ALTER CLUSTER "large-default-cluster" WITH (
NODE_COUNT 2,
AUTO_SUSPEND 600
);
ALTER COMPUTE CLUSTER

The following example suspends a compute cluster called test2:

  • The cluster will be suspended in 60 seconds.
  • The cluster will not cancel existing queries before suspending.
premdb=> ALTER CLUSTER "test2"
SUSPEND 60 
WITHOUT CANCEL;
ALTER COMPUTE CLUSTER

Examples with Actions on a Cluster

The following example resumes a cluster:

premdb=> alter cluster "bobr-rc6-April12-cluster1" resume;
ALTER COMPUTE CLUSTER

The following example renames a cluster:

premdb=> alter cluster "bobr-rc6-April12-cluster1" rename to "bobr-rc6-cluster1";
ALTER COMPUTE CLUSTER

Parent topic:SQL Commands