What you will be able to do
- Explain what Time Travel lets you do and which SQL extensions support it
- State the Time Travel retention limits for each edition and table type, and how the effective retention is calculated
- Distinguish Fail-safe from Time Travel by duration, configurability and who can recover data
- Describe how zero-copy cloning uses storage and what a clone does and does not inherit
Key concept
Data retention period — The number of days Snowflake keeps the previous state of changed or dropped data. Time Travel queries, clones of past states and UNDROP all work only inside this window. When it ends, data from permanent objects moves into Fail-safe.
1.Time Travel: going back to data that has changed
Every UPDATE, DELETE or DROP in Snowflake leaves something behind. When data in a table is modified, Snowflake keeps the state of the data from before the change. Time Travel is the feature that lets you reach that earlier state: it gives you access to data that has been changed or deleted, at any point within a defined period.
The documentation names three things you can do inside that period:
- Query past data that has since been updated or deleted. - Clone entire tables, schemas and databases at or before specific points in the past. - Restore tables, schemas, databases and some other objects that have been dropped.
Two SQL extensions make this possible. The AT | BEFORE clause goes in a SELECT statement or a CREATE … CLONE command, right after the object name. It locates the historical data with one of three parameters: TIMESTAMP, OFFSET (seconds back from now) or STATEMENT (a query ID). The UNDROP <object> command brings back dropped tables, schemas, databases, accounts, external volumes and tags. When you query historical data in a table or non-materialized view, Snowflake applies the current schema of that table or view.
Checkpoint 1 of 6· Match them up
Match each Time Travel element to what it does
Tap a term, then the definition that fits it.
AT | BEFORE takes TIMESTAMP, OFFSET or STATEMENT to locate the data. UNDROP is the separate command for restoring dropped objects.
“UNDROP <object> command for tables, schemas, databases, accounts, external volumes, and tags.”Source: docs.snowflake.com
Sources1
2.The retention period: how far back you can go
You don't have to turn Time Travel on. Every account gets the standard 1-day retention period automatically. How far you can change that depends on the edition and on whether the object is permanent:
| Edition | Object type | Allowed retention |
|---|---|---|
| Standard | Databases, schemas, tables (account and object level) | 0, or the default of 1 day |
| Enterprise and higher | Transient databases, schemas, tables; temporary tables | 0, or the default of 1 day |
| Enterprise and higher | Permanent databases, schemas, tables | Any value from 0 up to 90 days |
The retention period is controlled by the DATA_RETENTION_TIME_IN_DAYS parameter. A user with the ACCOUNTADMIN role sets the account default with it. The same parameter overrides that default when you create a database, schema or table, and you can change it at any time. A value set on a database or schema is inherited by the objects created inside it. Longer retention means more stored data, and that shows up in your monthly storage charges.
Two details come up often:
- Retention 0. Setting 0 on an object turns off Time Travel for that object. If you then drop it, you can't restore it. Time Travel can't be turned off for a whole account, though. Setting 0 at the account level only changes the default for new objects, and each object can still override it.
- A minimum floor. ACCOUNTADMIN can also set MIN_DATA_RETENTION_TIME_IN_DAYS at the account level. It doesn't replace an object's own setting. Instead, the effective retention becomes MAX(DATA_RETENTION_TIME_IN_DAYS, MIN_DATA_RETENTION_TIME_IN_DAYS). So an object set to 0 still keeps history if the account minimum is higher.
To see an object's current retention, look at the retention_time column returned by SHOW TABLES, SHOW SCHEMAS or SHOW DATABASES:
SHOW TABLES
->> SELECT "name", "retention_time"
FROM $1
WHERE "name" IN ('MY_TABLE1', 'MY_TABLE2');Checkpoint 2 of 6· Fill the gap
This query lists databases whose retention is longer than the default, including databases that have already been dropped. Which keyword completes it?
SHOW DATABASES ?
->> SELECT "name", "retention_time", "dropped_on"
FROM $1
WHERE "retention_time" > 1;Adding the HISTORY clause to a SHOW command includes objects that have already been dropped, which is why the dropped_on column is useful here.
Source: docs.snowflake.comCheckpoint 3 of 6· 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.
Sources1
3.Fail-safe: Snowflake's last resort after Time Travel ends
When an object's retention period ends, its historical data moves into Fail-safe. From then on, you can't query it, clone past states of the object, or restore it if it was dropped. Fail-safe is separate from Time Travel and has a different job: it protects historical data in case of a system failure or another event, such as a security breach.
The Fail-safe period is 7 days, can't be configured, and starts as soon as Time Travel retention ends. One exception: a long-running Time Travel query delays the move into Fail-safe until the query finishes. Fail-safe isn't a longer Time Travel window. Only Snowflake uses it, to recover data lost or damaged in extreme operational failures, and it works on a best-effort basis.
| Property | Fail-safe |
|---|---|
| Length | 7 days, not configurable |
| When it starts | As soon as the Time Travel retention period ends |
| Who recovers data | Snowflake, after you open a case with Snowflake Support |
| Recovery time | From several hours to several days |
| Compute used | Snowflake-managed serverless compute (FAILSAFE_RECOVERY service type) |
| Intended use | Only after all other recovery options have been tried |
Not all historical data gets to Fail-safe. With retention set to 0, a background process moves modified or deleted data into Fail-safe for permanent tables, but deletes it for transient tables. Fail-safe storage counts toward your account's storage. With the ACCOUNTADMIN role, you can see it in Snowsight under Admin » Cost management » Consumption, filtered to Storage.
Checkpoint 4 of 6· Check yourself
A user dropped a permanent table 9 days ago. Its retention period was 1 day. Which statement is correct?
Fail-safe starts when Time Travel ends and lasts 7 days, so this table's protection ran out after day 8. Inside that window only Snowflake Support could have recovered it. UNDROP and AT queries never reach Fail-safe.
“This period starts immediately after the Time Travel retention period ends.”Source: docs.snowflake.com
Sources2
4.Zero-copy cloning: instant copies that share storage
Cloning gives you a quick snapshot of a table, schema or database: a new object that starts out sharing the source's underlying storage. Because nothing is physically copied, a clone works as an instant backup with no extra cost until someone changes the clone. After that, each object has its own life cycle, and changes to one don't affect the other. Combined with Time Travel, you can also clone an object as it was at an earlier point.
A clone does not carry everything over:
- Grants. For most objects, CREATE … CLONE doesn't copy grants on the source object. Commands that support COPY GRANTS, such as CREATE TABLE, can copy every privilege except OWNERSHIP. When you clone a database or schema, the cloned child objects inherit the privileges granted on the source children, but the cloned container itself doesn't.
- History. A cloned table's Time Travel history starts when the clone is created. Unconsumed records in cloned streams can't be accessed.
- Scheduled work. Tasks and alerts in a cloned database or schema start suspended. A cloned pipe starts paused, or in the STOPPED_CLONED state if AUTO_INGEST = TRUE. Automatic Clustering is suspended on a cloned table until you resume it.
- Exclusions when cloning with Time Travel. External tables and internal (Snowflake) stages aren't cloned.
Object parameters set on the source carry over to the clone. Masking and row access policies stay attached to the cloned table.
ALTER TABLE <name> RESUME RECLUSTERCheckpoint 5 of 6· Check yourself
You clone a schema that contains a scheduled task. What is the state of the task in the cloned schema?
Tasks in a cloned database or schema start suspended and have to be resumed one by one. (Tasks are left out only when you clone a schema with a timestamp.)
“When a database or schema that contains tasks is cloned, the tasks in the clone are suspended by default.”Source: docs.snowflake.com
Checkpoint 6 of 6· 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.
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Fail-safe gives users 7 more days to query or UNDROP data once Time Travel ends.Why is that wrong?
Users can't reach Fail-safe themselves. Only Snowflake recovers data from it, on a best-effort basis, after you open a Support case.
Covered in Fail-safe: Snowflake's last resort after Time Travel ends
2.Every table's expired history goes into Fail-safe.Why is that wrong?
With retention at 0, the background process moves permanent-table data into Fail-safe but deletes transient-table data.
Covered in Fail-safe: Snowflake's last resort after Time Travel ends
3.Setting DATA_RETENTION_TIME_IN_DAYS = 0 on a table always turns off its Time Travel.Why is that wrong?
If MIN_DATA_RETENTION_TIME_IN_DAYS is set at the account level, the effective retention is the larger of the two values.
4.A cloned table automatically gets the same grants as its source table.Why is that wrong?
For most objects, CREATE … CLONE doesn't copy grants on the source object. You need COPY GRANTS where it's supported, or new GRANT statements.
Covered in Zero-copy cloning: instant copies that share storage
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Snowflake Time Travel enables accessing historical data (that is, data that has been changed or deleted) at any point within a defined period.”
↩︎ Time Travel: going back to data that has changed“Create clones of entire tables, schemas, and databases at or before specific points in the past.”
↩︎ Time Travel: going back to data that has changed“The standard retention period is 1 day (24 hours) and is automatically enabled for all Snowflake accounts”
↩︎ The retention period: how far back you can go“When an object with no retention period is dropped, you will not be able to restore the object.”
↩︎ The retention period: how far back you can go“Time Travel cannot be deactivated for an account.”
↩︎ The retention period: how far back you can go“the period is inherited by default for all objects created in the database/schema”
↩︎ The retention period: how far back you can go“The data retention period specifies the number of days for which this historical data is preserved”
↩︎ Key concept“any modified or deleted data is moved into Fail-safe (for permanent tables) or deleted (for transient tables) by a background process.”
↩︎ Exam trap 2“the effective minimum data retention period for an object is determined by MAX(DATA_RETENTION_TIME_IN_DAYS, MIN_DATA_RETENTION_TIME_IN_DAYS).”
↩︎ Exam trap 3“UNDROP <object> command for tables, schemas, databases, accounts, external volumes, and tags.”
↩︎ Checkpoint“For permanent databases, schemas, and tables, the retention period can be set to any value from 0 up to 90 days.”
↩︎ Prediction - 2.
“Fail-safe provides a (non-configurable) 7-day period during which historical data may be recoverable by Snowflake.”
↩︎ Fail-safe: Snowflake's last resort after Time Travel ends“To recover data from Fail-safe, open a case with Snowflake Support.”
↩︎ Fail-safe: Snowflake's last resort after Time Travel ends“Data recovery through Fail-safe uses Snowflake-managed serverless compute.”
↩︎ Fail-safe: Snowflake's last resort after Time Travel ends“Fail-safe is not provided as a means for accessing historical data after the Time Travel retention period has ended.”
↩︎ Exam trap 1“This period starts immediately after the Time Travel retention period ends.”
↩︎ Checkpoint - 3.
“create a derived copy of that object which initially shares the underlying storage”
↩︎ Zero-copy cloning: instant copies that share storage“creating instant backups that do not incur any additional costs (until changes are made to the cloned object)”
↩︎ Zero-copy cloning: instant copies that share storage - 4.
“If a table is cloned, historical data for the table clone begins at the time/point when the clone was created.”
↩︎ Zero-copy cloning: instant copies that share storage“By default, Automatic Clustering is suspended for the new table.”
↩︎ Zero-copy cloning: instant copies that share storage“statements for most objects do not copy grants on the source object to the object clone”
↩︎ Exam trap 4“When a database or schema that contains tasks is cloned, the tasks in the clone are suspended by default.”
↩︎ Checkpoint