# CLEAR ORPHAN DATABASES

The `CLEAR ORPHAN DATABASES` command removes orphaned partitions. Orphaned partitions are partition databases and tables on leaf nodes that are no longer considered part of the cluster.

## Syntax

```
CLEAR ORPHAN DATABASES;

```

## Remarks

> **⚠️ Warning**: This command cannot be undone.

* The master aggregator will not drop orphan partition databases if there is no corresponding master partition.
* This command causes implicit commits. Refer to [COMMIT](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-manipulation-language-dml/commit.md) for more information.
* To detect orphan partitions, run `SHOW CLUSTER STATUS` and check for partitions with the role of `Orphan`.
* Before running `CLEAR ORPHAN DATABASES`, run: `EXPLAIN CLEAR ORPHAN DATABASES;` to see which partitions will be dropped.
* Orphan tables are tables that don't exist in metadata but do exist on some partition databases. For example, if a table is dropped on the master in asynchronous replication and its node fails before it can succeed then the table could become an orphan table.

**Related Topics**

* [SHOW CLUSTER STATUS](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/show-cluster-status.md)
* [EXPLAIN](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-manipulation-language-dml/explain.md)

***

Modified at: June 11, 2026

Source: [/db/v9.1/reference/sql-reference/operational-commands/clear-orphan-databases/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/operational-commands/clear-orphan-databases/)

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