Database management

You can add and remove databases, as well as view information about them.

Getting a list of cluster databases

  1. Go to the folder page and select Managed Service for ClickHouse.
  2. Click on the name of the cluster you need and select the Databases tab.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To get a list of databases in a cluster, run the command:

$ yc managed-clickhouse database list
     --cluster-name=<cluster name>

The cluster name can be requested with a list of folder clusters.

To get a list of cluster databases, use the list method.

Creating a database

The number of databases in a cluster is unlimited.

  1. Go to the folder page and select Managed Service for ClickHouse.
  2. Click on the name of the cluster you need.
  3. Select the Databases tab.
  4. Click Add.
  5. Enter the DB name and click Add.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

Run the create database command and set the name of the new database:

$ yc managed-clickhouse database create <database name>
    --cluster-name <cluster name>

Managed Service for ClickHouse runs the create database operation.

The cluster name can be requested with a list of folder clusters.

You can create a new database in a cluster using the create method.

Deleting a database

  1. Go to the folder page and select Managed Service for ClickHouse.
  2. Click on the name of the cluster you need and select the Databases tab.
  3. Click image in the line of the necessary DB and select Delete.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To delete a database, run the command:

$ yc managed-clickhouse database delete <database name>
     --cluster-name=<cluster name>

The cluster name can be requested with a list of folder clusters.

You can delete a database using the delete method.

Important

Before creating a new database with the same name, wait for the delete operation to complete, otherwise the database being deleted is restored. Operation status can be obtained with a list of cluster operations.