Skip to main content
Deletes a data snapshot from a repository, together with the data files it holds in the remote storage system. Unlike DROP REPOSITORY, which only removes the mapping in the database, this statement removes the backed-up data itself. The deletion is irreversible. Once a snapshot is dropped, it can no longer be restored with RESTORE. This statement is supported from v4.2.0 onwards. Caution
  • The snapshot cannot be dropped while a BACKUP job is writing it or a RESTORE job is reading it.
  • The snapshot cannot be dropped if its repository is read-only.

Privilege requirement

Users must have the REPOSITORY privilege at the System level.

Syntax

Parameters

Snapshot ownership

Each snapshot records the ID of the cluster that created it. Without FORCE, the database deletes the snapshot only when that ID matches the current cluster, which you can read from the ClusterId column of SHOW SNAPSHOT and the ClusterId column of SHOW FRONTENDS. The statement is rejected when the snapshot:
  • was created by another cluster sharing the same repository,
  • was created before v4.2.0 and therefore records no cluster ID, or
  • has no readable snapshot metadata, which is the case while a backup is still running and after a backup was interrupted.
Use FORCE to delete such a snapshot anyway. Deleting a snapshot that this cluster did not create removes data that another cluster may still depend on, so confirm that the data is yours to remove before using it.

Examples

Example 1: Deletes the snapshot backup1 from repository example_repo.
Example 2: Deletes the snapshot legacy_backup from repository example_repo even though it was not created by this cluster.

References