# REBALANCE ALL DATABASES

Rebalances the partitions on all databases in the cluster.

## Syntax

```sql
REBALANCE ALL DATABASES[KILL][ENSURE_ONLINE_NODES];

```

## Remarks

* This command runs [`REBALANCE PARTITIONS ... FULL`](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/rebalance-partitions.md) on each database in the cluster, in alphabetical order of the database name. When `REBALANCE PARTITIONS ... FULL` runs on a database `d`, it first considers the placement of the partitions of the other databases in the cluster before rebalancing the partitions of `d`. Refer to [REBALANCE PARTITIONS](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/rebalance-partitions.md) for an example of `REBALANCE PARTITIONS ... FULL`.
* If MemSQL Ops is not enabled for manual cluster control, then a `REMOVE LEAF` can result in the leaf being added back without user intervention.
* `ENSURE_ONLINE_NODES` allows rebalancing to run only if all the leaf nodes are online.
* To see the status of running this command, run [SHOW REBALANCE ALL DATABASES STATUS](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/show-rebalance-all-databases-status.md). You can also run [EXPLAIN REBALANCE ALL DATABASES](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/explain-rebalance-all-databases.md) to see the series of steps that the command `REBALANCE ALL DATABASES` would run, if you executed it.

***

Modified at: December 2, 2024

Source: [/db/v9.1/reference/sql-reference/cluster-management-commands/rebalance-all-databases/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/rebalance-all-databases/)

(An index of the documentation is available at /llms.txt)
