Updates attributes on an existing cluster.
ALTER CLUSTER <cluster> <attribute-name> <attribute-value>
<cluster>Defines the cluster you want to change. You can use its logical name or ID. Beginning with version 2.2, you can use the wildcard
*to update multiple clusters together.
<attribute-name>Defines the attribute you want to change. For a list of supported attributes, see the table below.
<attribute-value>Defines the value you want to set.
Change the name of a cluster, using its name:
ALTER CLUSTER profile NAME "profile2"
IMPORTANT: cluster name, status, compression, conflictstrategy are strings, so they have to be "quoted"
Change the name of a cluster, using its ID:
ALTER CLUSTER 9 NAME "profile2"
Update the cluster conflict strategy to
ALTER CLUSTER V CONFLICTSTRATEGY "automerge"
ALTER CLUSTER V_2012 STATUS "OFFLINE"
Update multiple clusters with a similar name:
ALTER CLUSTER employee* status "offline"
||String||Changes the cluster name.|
||String||Changes the cluster status. Allowed values are
||String||Defines the compression type to use. Allowed values are
||Boolean||Defines whether it uses the Journal (Write Ahead Log) when OrientDB operates against the cluster.|
||Integer||Defines the grow factor to save more space on record creation. You may find this useful when you update the record with additional information. In larger records, this avoids defragmentation, as OrientDB doesn't have to find new space in the event of updates with more data.|
||Integer||Defines grow factor on updates. When it reaches the size limit, is uses this setting to get more space, (factor > 1).|
||String||2.0+||Defines the strategy it uses to handle conflicts in the event that OrientDB MVCC finds an update or a delete operation it executes against an old record. If you don't define a strategy at the cluster-level, it uses the database-level configuration. For more information on supported strategies, see the section below.|
||Throws an exception when versions are different. This is the default setting.|
||In the event that the versions are different, it checks for changes in the content, otherwise it uses the highest version to avoid throwing an exception.|
||Merges the changes.|
To know more about other SQL commands, take a look at SQL Commands.