A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/sql/create-snapshot below:

Website Navigation


CREATE SNAPSHOT | Snowflake Documentation

CREATE SNAPSHOT

Creates or replaces a snapshot of a named volume from the specified service instance. The snapshot is created in the current schema.

See also:

ALTER SNAPSHOT, DESCRIBE SNAPSHOT, DROP SNAPSHOT , SHOW SNAPSHOTS

Syntax
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>' [ , ... ] ) ]

Copy

Required parameters
name

String 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_name

Specifies the name of the service.

VOLUME "volume_name"

Specifies 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_id

Index 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.

Optional parameters
COMMENT = 'string_literal'

Specifies a comment for the service.

Default: No value

TAG ( tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ] )

Specifies 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 quota for objects.

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

The USAGE privilege on the parent database and schema are required to perform operations on any object in a 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.

Usage notes Examples

If you create a service with two instances (the number of containers isn’t relevant) with a volume named “data”, you would create a snapshot of the volume associated with the first instance using the following SQL:

CREATE SNAPSHOT snapshot_0
  FROM SERVICE example_service
  VOLUME "data"
  INSTANCE 0
  COMMENT='new snapshot';

Copy

To create a snapshot of the volume associated with the second service instance, you specify INSTANCE 1 in the preceding SQL.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4