What you will be able to do
- Recover changed or dropped data with AT | BEFORE queries and UNDROP while the retention period lasts
- Set DATA_RETENTION_TIME_IN_DAYS and predict the effective retention an object inherits
- Explain what Fail-safe protects, who can use it and what it costs
- Predict what a zero-copy clone shares with its source and what it does not inherit
Key concept
Data retention period — The number of days Snowflake keeps the previous state of changed or dropped data so that you can query it, clone it or restore it yourself. When the period ends, that history moves into Fail-safe and only Snowflake can reach it.
1.Recovering past data with Time Travel
Time Travel lets you work with data as it was before someone changed it. When a row is updated or deleted, or a table is dropped, Snowflake keeps the earlier state for the length of the object's data retention period. During that window you can do three things with the history: query it, clone it, or restore a dropped object. Time Travel is on by default, so none of this needs setting up in advance.
To query the past, use the AT | BEFORE clause. It goes immediately after the object name in a SELECT or a CREATE … CLONE statement, and it picks the moment with one of three parameters:
TIMESTAMP: a point in timeOFFSET: a time difference in seconds from the presentSTATEMENT: the query ID of a statement
Here is a typical case. An analyst runs an UPDATE that writes wrong values over several thousand rows, and notices ten minutes later. They query the table with AT and an OFFSET set to a point before the update, then use that result set to correct the damaged rows. This needs no backup and no support case. It is also not something a warehouse administrator can undo. A virtual warehouse only supplies compute for queries; it holds no data state that could be rolled back.
UNDROP restores dropped tables, schemas, databases, accounts, external volumes and tags. If a developer dropped a production table two minutes ago and its retention period has not run out, UNDROP TABLE with the table's name brings it back as it was just before the drop. Undropping a schema or a database restores every object inside it. While Time Travel still covers the object, Fail-safe and Snowflake Support play no part in the recovery.
Checkpoint 1 of 9· Check yourself
An analyst ran an UPDATE that wrote wrong values over several thousand rows of a permanent table and noticed 10 minutes later. The table's retention period is 1 day. What is the best way to get the correct values back?
The change is still inside the retention period, so Time Travel lets the user query the table's earlier state with AT | BEFORE. Fail-safe and Snowflake Support play no part while Time Travel still covers the data. UNDROP only restores dropped objects, and a warehouse holds no data state that could be rolled back.
“Query data in the past that has since been updated or deleted.”Source: docs.snowflake.com
Checkpoint 2 of 9· Exam question
An analyst on Enterprise Edition ran an UPDATE statement ten minutes ago that overwrote several thousand rows in a permanent table with incorrect values, and the table's Time Travel retention is still set to the default. Which approach lets the analyst recover the pre-update row values without restoring a backup or contacting Snowflake Support?
Correct answer: A — Query the table with an AT clause using OFFSET set to the number of seconds before the update, then use the result set to correct the affected rows.
- A. Querying with an AT clause and an OFFSET value reconstructs the table as it existed just before the update, which is exactly what Time Travel is designed for on a permanent table still within its retention window.
- B. Fail-safe is not self-service and only applies once the Time Travel retention period has fully elapsed, so it is not the mechanism used here and would also require Snowflake Support intervention rather than the analyst acting alone.
- C. Relying on an external export assumes such a backup exists and is current, and it ignores the built-in Time Travel capability that already retains the prior row versions inside Snowflake.
- D. Virtual warehouses are stateless compute clusters with no concept of rollback; they do not store table data or track DML history, so this action has no effect on the table's contents.
Checkpoint 3 of 9· Exam question
A developer accidentally executed DROP TABLE on a production table two minutes ago, and the table's data retention period has not expired. What is the fastest supported way to restore the table exactly as it existed immediately before the drop?
Correct answer: A — Run an UNDROP TABLE statement naming the dropped table, which restores it to its state immediately before deletion.
- A. UNDROP restores a dropped table, schema, or database to the state it held immediately before deletion, provided the action is taken within the Time Travel retention period, making it the fastest native recovery path.
- B. Query history only shows executed statements and their metadata, not a reliable full row-level export, so manually reconstructing the table this way is error-prone and unnecessary when the table can simply be undropped.
- C. Fail-safe is reserved for the period after Time Travel expires and requires Snowflake Support, so involving support here is both slower and unnecessary since the table is still within its retention window.
- D. Restoring an entire database from an external nightly snapshot would revert unrelated tables and lose intervening changes, and it ignores that Snowflake already retains the exact prior state internally.
2.Setting and inheriting the retention period
Every Snowflake account gets a standard retention period of 1 day (24 hours), switched on automatically. How far you can raise it depends on the edition (Snowflake editions (Standard, Enterprise, Business Critical, VPS)). Standard Edition allows only 0 or the 1-day default. On Enterprise Edition and higher, permanent databases, schemas and tables can be set to any value from 0 to 90 days. Transient and temporary objects stay at 0 or 1 day on every edition. Longer retention is not free: the extra history is stored and shows up in your monthly storage charges.
Retention is set with the DATA_RETENTION_TIME_IN_DAYS parameter, and lower levels inherit from higher ones. A user with the ACCOUNTADMIN role sets the account default. You can override that default when you create a database, schema or table. A period set on a database or schema is inherited by default by every object created inside it, and you can change any object's period at any time. To see what an object actually has, look at the retention_time column of SHOW TABLES, SHOW SCHEMAS or SHOW DATABASES. Add HISTORY to the SHOW command to include objects that have already been dropped.
SHOW TABLES
->> SELECT "name", "retention_time"
FROM $1
WHERE "name" IN ('MY_TABLE1', 'MY_TABLE2');Setting a retention period of 0 turns off Time Travel for that object, and the cost is real: if an object with no retention period is dropped, it cannot be restored. Snowflake recommends keeping at least 1 day on every object. At the account level, 0 does not turn Time Travel off. It only makes 0 the default for new databases, and any database, schema or table can still override it. An ACCOUNTADMIN can also set MIN_DATA_RETENTION_TIME_IN_DAYS on the account to enforce a minimum. The parameter does not replace an object's own setting. Instead, the effective period becomes MAX(DATA_RETENTION_TIME_IN_DAYS, MIN_DATA_RETENTION_TIME_IN_DAYS), so a table set to 0 in an account with a minimum of 7 actually keeps 7 days.
Each change gets its own clock: the end of Time Travel for a version is the time of the change plus the retention period. So an old table does not lose its history all at once. A row updated this morning stays reachable for a full period from this morning, whatever the table's creation date. When a version's clock runs out, you can no longer query it, clone it at that point, or restore it if it was dropped.
Checkpoint 4 of 9· Check yourself
In an Enterprise Edition account, the ACCOUNTADMIN has set MIN_DATA_RETENTION_TIME_IN_DAYS = 7. A developer creates a permanent table with DATA_RETENTION_TIME_IN_DAYS = 0 and drops it by mistake the next day. What happens when they run UNDROP TABLE?
MIN_DATA_RETENTION_TIME_IN_DAYS does not replace the table's own setting. The effective period is MAX(0, 7) = 7 days, so the dropped table is still inside Time Travel and UNDROP restores it.
“When this parameter is set at the account level, the effective minimum data retention period for an object is determined by MAX(DATA_RETENTION_TIME_IN_DAYS, MIN_DATA_RETENTION_TIME_IN_DAYS).”Source: docs.snowflake.com
Checkpoint 5 of 9· Fill the gap
You want to see how many days of Time Travel two tables actually have. Which column completes this query?
SHOW TABLES
->> SELECT "name", " ? "
FROM $1
WHERE "name" IN ('MY_TABLE1', 'MY_TABLE2');The SHOW TABLES, SHOW SCHEMAS and SHOW DATABASES output reports an object's retention period in the retention_time column. DATA_RETENTION_TIME_IN_DAYS and MIN_DATA_RETENTION_TIME_IN_DAYS are the parameters you set, not columns in the SHOW output.
Source: docs.snowflake.comCheckpoint 6 of 9· Exam question
What is the maximum Time Travel retention period that can be configured for a permanent table on Snowflake Enterprise Edition or higher?
Correct answer: A — 90 days
- A. Enterprise Edition and higher allow the DATA_RETENTION_TIME_IN_DAYS parameter to be set up to 90 days for permanent tables, compared to the fixed 1-day maximum on Standard Edition.
- B. One day is the fixed retention available on Standard Edition, not the maximum available once an account is on Enterprise Edition or higher, which supports a much longer configurable window.
- C. There is no built-in 365-day Time Travel retention tier in Snowflake; extending retention that far is not an available configuration for any edition.
- D. Seven days is commonly associated with the Fail-safe period for permanent tables, not the configurable Time Travel retention window, so it does not answer what this question asks.
Sources1
3.Fail-safe: the 7 days only Snowflake can use
Fail-safe is a separate 7-day period that starts as soon as Time Travel ends. It protects historical data against system failures and events such as a security breach. You cannot change its length, and you cannot use it yourself. It does not let you query or undrop data after Time Travel. Snowflake uses it to recover data lost or damaged in extreme operational failures, on a best-effort basis, and only after every other recovery option has been tried. To start a recovery, you open a case with Snowflake Support. The recovery can take from several hours to several days.
Fail-safe costs money in two ways. The data held in Fail-safe counts toward storage, and an ACCOUNTADMIN can see it in Snowsight under Admin » Cost management » Consumption, filtered to Storage. An actual recovery runs on Snowflake-managed serverless compute and is billed at the standard serverless rate. Those credits appear in the metering history views under the FAILSAFE_RECOVERY service type.
Whether a table has Fail-safe at all depends on its type (Table types: permanent, temporary, transient, Iceberg, external). Transient and temporary tables have no Fail-safe period, which is the point of using them for data you could reload anyway. If you set a transient table's retention to 0, its changed data is simply deleted. On a permanent table, the same change sends the data to Fail-safe instead.
| Table type | Time Travel retention (days) | Fail-safe (days) |
|---|---|---|
| Permanent, Standard Edition | 0 or 1 | 7 |
| Permanent, Enterprise Edition and higher | 0 to 90 | 7 |
| Transient | 0 or 1 | 0 |
| Temporary | 0 or 1 | 0 |
Snowpipe Streaming is a way of ingesting data into tables, and it comes in two architectures. The classic architecture is the original implementation and is planned for future deprecation. The high-performance architecture is the one Snowflake recommends for new implementations. Only the classic one affects Fail-safe: a table that contains data ingested through it cannot use Fail-safe for recovery, so such a table has no protection beyond Time Travel.
Checkpoint 7 of 9· Check yourself
Four days ago, a developer dropped a permanent production table whose retention period is 1 day. Nobody noticed until today. What can the team do to get the table back?
The 1-day Time Travel window has closed, so the table's history is now in its 7-day Fail-safe period. Users can't query or UNDROP data in Fail-safe. Only Snowflake can recover it, through a support case and on a best-effort basis. A permanent table isn't deleted when retention ends; that happens only to transient and temporary tables, which have no Fail-safe.
“To recover data from Fail-safe, open a case with Snowflake Support.”Source: docs.snowflake.com
4.Zero-copy cloning: what a clone shares and what it leaves behind
A clone is a new table, schema or database that starts out sharing its source's storage instead of copying it. At creation, the source and the clone point to the same existing micro-partitions. Their storage only diverges as one side or the other is modified, and from then on each pays for its own changed data. This makes a clone of a large production database fast to create and cheap to keep while it stays unchanged. Combined with Time Travel, CREATE … CLONE … AT(...) copies an object as it was at a past point.
Privileges are where clones most often surprise people. When you clone a database or schema, the child objects inside the clone keep the privileges granted on their source objects. The cloned database or schema itself does not inherit the grants on the source container. When you clone a single object, most CREATE … CLONE statements copy no grants at all. Commands that support COPY GRANTS, such as CREATE TABLE … CLONE, can copy every privilege except OWNERSHIP. In every other case you grant access to the clone yourself.
A clone keeps the object parameters that were set on its source. Its history, however, starts fresh: Time Travel on a cloned table begins at the moment the clone was created, and unconsumed records in cloned streams cannot be accessed. Several objects come over only partly, or in a stopped state:
- Table stages are cloned empty, because files sitting in a source table stage are not copied.
- Internal named stages are cloned only when you add
INCLUDE INTERNAL STAGES. External named stages are cloned, and the cloud storage they reference is left untouched. - Tasks and alerts in a cloned database or schema start suspended, and Automatic Clustering is suspended on a cloned clustered table.
- Cloned pipes start paused, or in the
STOPPED_CLONEDstate whenAUTO_INGEST = TRUE. - A cloned table references the cloned sequence only if the sequence's schema or database was cloned along with it. Otherwise it keeps referencing the source sequence.
Cloning at a past point adds more exclusions. External tables and internal stages are not cloned when you use Time Travel. User tasks are left out when a schema is cloned with a timestamp, even though a plain clone of the same schema includes them.
Checkpoint 8 of 9· Check yourself
A QA role has USAGE on PROD_DB and SELECT on the tables inside it. You run CREATE DATABASE TEST_DB CLONE PROD_DB. The QA role still can't use TEST_DB. What is the cause, and what is the fix?
When you clone a database, its child objects keep the privileges granted on their source objects. The cloned database itself does not inherit the grants made on the source database, so only the database-level grant has to be added again.
“The clone of the container itself (database or schema) doesn’t inherit the privileges granted on the source container.”Source: docs.snowflake.com
Checkpoint 9 of 9· Match them up
You clone a production schema without using Time Travel. Match each item from the source to its state in the clone.
Tap a term, then the definition that fits it.
A clone brings many objects over only partly or in a stopped state. Tasks, alerts, pipes and Automatic Clustering have to be resumed. Table-stage files are not copied, and internal named stages need INCLUDE INTERNAL STAGES.
“When a database or schema that contains tasks is cloned, the tasks in the clone are suspended by default.”Source: docs.snowflake.com
Sources
(6)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“OFFSET (time difference in seconds from the present time)”
↩︎ Recovering past data with Time Travel“UNDROP <object> command for tables, schemas, databases, accounts, external volumes, and tags.”
↩︎ Recovering past data with Time Travel“Query data in the past that has since been updated or deleted.”
↩︎ Recovering past data with Time Travel“For permanent databases, schemas, and tables, the retention period can be set to any value from 0 up to 90 days.”
↩︎ Setting and inheriting the retention period“The standard retention period is 1 day (24 hours) and is automatically enabled for all Snowflake accounts”
↩︎ Setting and inheriting the retention period“the period is inherited by default for all objects created in the database/schema.”
↩︎ Setting and inheriting the retention period“When an object with no retention period is dropped, you will not be able to restore the object.”
↩︎ Setting and inheriting the retention period“End of Time Travel = time of the change + data retention period”
↩︎ Setting and inheriting the retention period“Note that extended data retention requires additional storage which will be reflected in your monthly storage charges.”
↩︎ Setting and inheriting the retention period“When using Time Travel, the following object types are not cloned:”
↩︎ Zero-copy cloning: what a clone shares and what it leaves behind“The data retention period specifies the number of days for which this historical data is preserved”
↩︎ Key concept“the higher value setting takes precedence”
↩︎ Exam trap 2“The retention period for a piece of historical data starts when that data is changed or dropped, not when the object was created.”
↩︎ Prediction“When this parameter is set at the account level, the effective minimum data retention period for an object is determined by MAX(DATA_RETENTION_TIME_IN_DAYS, MIN_DATA_RETENTION_TIME_IN_DAYS).”
↩︎ Checkpoint - 2.
“The only charges to consumers are for the compute resources (i.e. virtual warehouses) used to query the imported data.”
↩︎ Recovering past data with Time Travel - 3.
“Fail-safe provides a (non-configurable) 7-day period during which historical data may be recoverable by Snowflake.”
↩︎ Fail-safe: the 7 days only Snowflake can use“To recover data from Fail-safe, open a case with Snowflake Support.”
↩︎ Fail-safe: the 7 days only Snowflake can use“Data recovery through Fail-safe uses Snowflake-managed serverless compute. Standard serverless compute billing applies.”
↩︎ Fail-safe: the 7 days only Snowflake can use“the classic architecture, which is the original implementation and is planned for future deprecation”
↩︎ Fail-safe: the 7 days only Snowflake can use“Fail-safe doesn’t support tables that contain data ingested by the Snowpipe Streaming classic architecture.”
↩︎ Fail-safe: the 7 days only Snowflake can use“Fail-safe is not provided as a means for accessing historical data after the Time Travel retention period has ended.”
↩︎ Exam trap 1 - 4.
“Transient and temporary tables have no Fail-safe period.”
↩︎ Fail-safe: the 7 days only Snowflake can use - 5.
“clones share the same underlying storage as the source table.”
↩︎ Zero-copy cloning: what a clone shares and what it leaves behind“CREATE <object> … CLONE statements for most objects do not copy grants on the source object to the object clone.”
↩︎ Zero-copy cloning: what a clone shares and what it leaves behind“Internal named stages are cloned if you use the INCLUDE INTERNAL STAGES clause.”
↩︎ Zero-copy cloning: what a clone shares and what it leaves behind“If a table is cloned, historical data for the table clone begins at the time/point when the clone was created.”
↩︎ Zero-copy cloning: what a clone shares and what it leaves behind“The clone of the container itself (database or schema) doesn’t inherit the privileges granted on the source container.”
↩︎ Exam trap 3“The clone of the container itself (database or schema) doesn’t inherit the privileges granted on the source container.”
↩︎ Checkpoint“When a database or schema that contains tasks is cloned, the tasks in the clone are suspended by default.”
↩︎ Checkpoint - 6.
“At clone time, the source and clone share existing micro-partitions through zero-copy cloning.”
↩︎ Zero-copy cloning: what a clone shares and what it leaves behind