# Enable tiered storage in Managed ClickHouse®


Enable the [tiered storage feature](/product/dbaas/service-specific/clickhouse/overview/clickhouse-tiered-storage/) on a table in your Managed ClickHouse® service.

Before you enable tiered storage, review the [limitations](/product/dbaas/service-specific/clickhouse/overview/clickhouse-tiered-storage/#tiered-storage-limitations).

## Prerequisites

-   You have at least one Managed ClickHouse service.
-   SQL and an SQL client (for example, the [ClickHouse client](/product/dbaas/service-specific/clickhouse/how-to/connect-with-clickhouse-cli/)).
-   All maintenance updates are applied on your service. Check the pending list with
  `exo x get-dbaas-service-clickhouse my-clickhouse -z ch-gva-2 -q 'maintenance'` and apply it
  with `exo x start-dbaas-clickhouse-maintenance my-clickhouse -z ch-gva-2`.

## Activate tiered storage on a table

You can enable tiered storage both on new tables and on existing ones.

1. [Connect to your Managed ClickHouse service](/product/dbaas/service-specific/clickhouse/how-to/list-connect-to-service/)
   using, for example, the ClickHouse client.
1. To activate the tiered storage feature on a specific table,
   set `storage_policy` to `tiered` on this table by executing the following SQL statement:

   ```sql
   ALTER TABLE database_name.table_name MODIFY SETTING storage_policy = 'tiered'
   ```

   > [!NOTE]
   > A hyphen is not valid in an unquoted ClickHouse identifier: the parser reads it as a
   > subtraction and the statement fails with a syntax error. Quote names that contain one
   > with backticks, as in ``ALTER TABLE `my-db`.`my-table` ``.

Tiered storage is activated on your table. From now on, data in this table is
distributed between two tiers: Network-attached block storage and object storage.

## What's next

- [Configure data retention thresholds for tiered storage](/product/dbaas/service-specific/clickhouse/how-to/configure-tiered-storage/)
- [Check data volume distribution between different disks](/product/dbaas/service-specific/clickhouse/how-to/check-data-tiered-storage/)

- [About tiered storage in Managed ClickHouse](/product/dbaas/service-specific/clickhouse/overview/clickhouse-tiered-storage/)
- [Transfer data between network-attached block storage and object storage](/product/dbaas/service-specific/clickhouse/how-to/transfer-data-tiered-storage/)

