SingleStore DB

DETACH DATABASE

Note

This command is in preview mode. At a future date, SingleStore will announce when this command will be available for production use.

Prior to using this command, the enable_bottomless and allow_point_in_time_attach engine variables must be set to ON. The default values for enable_bottomless and allow_point_in_time_attach, respectively, are ON and OFF.

Takes an unlimited storage databaseoffline, and removes the reference to it from the cluster.

Syntax

DETACH DATABASE remote_database_name [AT MILESTONE milestone_name | FORCE]

Arguments
milestone_name

A quoted string that is the milestone to detach the database at.

Remarks
  • If FORCE is specified, the following applies:

    • The database is dropped from the SingleStore cluster. All data in the detached database that is stored locally in the cluster is deleted (and not uploaded to remote storage). However, FORCE does not remove the corresponding database files from the remote object store; you should remove these files manually, if desired.

  • If FORCE is not specified, the following apply:

    • A milestone (a restore point) is created. The CREATE MILESTONE command is run implicitly.

    • While the milestone is being created, SingleStore uploads the remote database's local cluster data to remote storage that has not yet been synced.

    • If milestone_name is not specified, a name containing the current timestamp is automatically generated.

  • DROP DATABASE cannot be run on unlimited storage databases.

  • After detaching a database, you can reattach the database using ATTACH DATABASE. The reattach can be done optionally at a milestone or a point in time, and with the same or a different database name.

Example
DETACH DATABASE db AT MILESTONE "m";