UNDROP SNAPSHOT
statementsupportedReplication, failover & backupNote This operation is not currently covered by the Service Level set forth in Snowflake’s Support Policy and Service Level Agreement. Restores a previously removed snapshot of a block storage volume. After Snowflake restores the snapshot, the data is available for use. 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
UNDROP SNAPSHOT { <name> | IDENTIFIER( <id> ) }
[ RENAME TO <new_snapshot_name> ];
Parameters
| Name | Required | Description |
|---|---|---|
name | Specifies the name of the snapshot to restore. If you specify a snapshot name, the command restores the most recently dropped snapshot with that name. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. For more information, see Identifier requirements. | |
IDENTIFIER( id ) | Specifies the system-generated identifier for the snapshot to restore. If you have multiple dropped snapshots with the same name, you can query the BLOCK_STORAGE_SNAPSHOTS view to get the system-generated identifier of the dropped snapshot that you want to restore. Then, use the IDENTIFIER keyword to specify that you want to restore this snapshot. The restored snapshot keeps its original name. For an example of restoring a snapshot by system-generated identifier, see Examples. Note You can only use the system-generated identifier with the IDENTIFIER() keyword when executing the UNDROP command for notebooks, tables, block storage snapshots, schemas, and databases. | |
RENAME TO new_snapshot_name | Specifies the name for the snapshot after it is restored. This lets you restore the snapshot to a different name. |
Usage notes
- Snapshots can only be restored to the database and schema where the snapshot was located at the time of deletion. For example, if you create and drop a snapshot in schema s1, then change the current schema in your session to s2 and attempt to undrop the snapshot, the snapshot will be restored in schema s1, not in the current schema s2.
- If a snapshot with the same name already exists, UNDROP SNAPSHOT returns an error. In this case, you have the option to specify a different name by using RENAME TO parameter.
- UNDROP SNAPSHOT relies on the Snowflake Time Travel feature. An object can be restored only if the object was deleted within the data retention period. The default retention period is 24 hours. After the data retention period has passed, you can’t restore the snapshot.
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes OWNERSHIP | Snapshot | OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege). 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.