UNDROP STAGE

statementsupportedData loading & unloading

docs.snowflake.com ↗

Object: STAGE

Restores a dropped named internal or external stage.

Syntax

UNDROP STAGE <name>

Parameters

NameRequiredDescription
nameSpecifies the identifier for the stage to restore. 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.

Usage notes

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes CREATE STAGE | Schema that contained the stage | Required for every stage type, including temporary stages. 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.

Retention period for dropped stages

For a named internal stage, the STAGE_UNDROP_RETENTION_TIME_IN_DAYS parameter determines how long the stage remains available to restore after it’s dropped. You can set the parameter at the account, database, schema, or stage level, and a stage inherits the value from the nearest level where it’s set. The default is 0 days, so the effective retention period must be increased before you drop a stage that you might need to restore. MIN_STAGE_UNDROP_RETENTION_TIME_IN_DAYS is an account-level minimum that also defaults to 0 days. When it’s set to a value greater than 0, the effective retention period for a stage is MAX(STAGE_UNDROP_RETENTION_TIME_IN_DAYS, MIN_STAGE_UNDROP_RETENTION_TIME_IN_DAYS), and setting STAGE_UNDROP_RETENTION_TIME_IN_DAYS below the minimum returns an error. Neither parameter can be set to a value greater than 1 day (Standard Edition) or 90 days (Enterprise Edition or higher). For more information, see Data retention period. Neither STAGE_UNDROP_RETENTION_TIME_IN_DAYS nor MIN_STAGE_UNDROP_RETENTION_TIME_IN_DAYS controls how long a dropped external stage remains available to restore. A dropped external stage remains restorable for the data retention period that applies to it.

See also

Referenced by