CREATE SNAPSHOT

statementsupportedReplication, failover & backup

docs.snowflake.com ↗

Object: SNAPSHOT

Note This operation is not currently covered by the Service Level set forth in Snowflake’s Support Policy and Service Level Agreement. Creates or replaces a snapshot of a block storage volume for a specified volume and service instance. The snapshot is created in the current schema. Snowpark Container Services is available to accounts in AWS, Microsoft Azure, and Google Cloud Platform commercial regions, with some exceptions. For more information, see Available regions and considerations.

Syntax

supportedpartialnot supportednot scored

CREATE [ OR REPLACE ] SNAPSHOT [ IF NOT EXISTS ] <name>
  FROM SERVICE <service_name>
  VOLUME "<volume_name>"
  INSTANCE <instance_id>
  [ COMMENT = '<string_literal>']
  [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , ... ] ) ]

Parameters

NameRequiredDescription
namerequiredString that specifies the identifier (that is, name) for the snapshot; must be unique for the schema in which the snapshot is created. In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (for example, "My object"). Identifiers enclosed in double quotes are also case-sensitive. For more information, see Identifier requirements.
FROM SERVICE service_namerequiredSpecifies the name of the service.
VOLUME "volume_name"requiredSpecifies the name of the volume associated with the service. Snapshots can only be taken for block storage volumes (and not for local, memory, or stage volumes). Volume names are case-sensitive. Therefore, double quotes should always be used to match the corresponding name in the service specification.
INSTANCE instance_idrequiredIndex of the service instance. The service instance index starts at 0 and the range is [0, ..., MAX_INSTANCES - 1]. You can call the SYSTEM$GET_SERVICE_STATUS — Deprecated function to get the relevant information.
COMMENT = 'string_literal'optionalSpecifies a comment for the service. Default: No value
TAG ( tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ] )optionalSpecifies the tag name and the tag string value. The tag value is always a string, and the maximum number of characters for the tag value is 256. For information about specifying tags in a statement, see Tag quotas.

Usage notes

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes CREATE SNAPSHOT | Schema | OPERATE | Service | Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

See also

Referenced by