Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Snowflake · SnowPro Core

Time Travel, Fail-safe, and Zero-Copy Cloning

SnowPro Core · Lesson 25 of 27 · 3:11:49

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the SnowPro Core Certification exam (COF-C03). In this lesson: Time Travel and retention, Fail-safe, zero-copy cloning, and replication across regions. Follows Foxglove Apparel, a fictional online clothing retailer. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Every price set to zero

On a Friday evening, an intern at Foxglove runs an update without a WHERE clause, and every price in the product catalog becomes zero. On Monday, the team must restore the catalog as it was, and the data scientists also want a full copy of production to test a new pricing model. Time Travel, Fail-safe, and zero-copy cloning each have a part to play.

Time Travel

Time Travel gives access to data that has been changed or dropped, for as long as its retention period lasts. The AT and BEFORE clauses, in a query or a clone, point to a timestamp, an offset in seconds, or the ID of a statement. UNDROP restores a dropped table, schema, or database to its most recent state, but it fails if an object with the same name exists, which you must rename first. The retention period starts when the data is changed or dropped, not when the object was created.

The retention period

Every account has a default retention period of one day, and Standard Edition allows zero or one day. Enterprise Edition allows up to ninety days for permanent objects, while transient and temporary objects keep zero or one day. ACCOUNTADMIN sets the account default with DATA_RETENTION_TIME_IN_DAYS, which databases, schemas, and tables can override, and their child objects inherit. MIN_DATA_RETENTION_TIME_IN_DAYS enforces a minimum, so the effective period is the higher of the two, and a period of zero means a dropped object cannot be restored.

Fail-safe

Fail-safe is a seven-day period that starts when Time Travel ends, for permanent objects, and it cannot be configured. Only Snowflake can recover data from Fail-safe, through a support case, on a best-effort basis, which can take from hours to days. It is a last resort after a system failure, not a way for users to query history. Transient and temporary tables have no Fail-safe, and the historical data kept by both Time Travel and Fail-safe adds to storage costs.

Zero-copy cloning

CREATE CLONE copies a database, a schema, or a table, among other objects, almost instantly. A clone shares the micro-partitions of its source, so it uses no extra storage at first, and changes on either side create new micro-partitions that belong to that side only. With AT or BEFORE, you can clone an object as it was at a point in the past, within its retention period. A clone of a database or schema keeps the grants on its child objects, but not on the container itself, and its tasks start suspended.

Replication across regions

Replication, from lesson thirteen, copies databases and other objects to accounts in other regions or clouds, as read-only secondaries refreshed from the primary. With failover groups, in Business Critical Edition, a secondary can be promoted to primary if a region fails. A direct share works only with accounts in the same region. To share data across regions or clouds, a provider uses a listing with cross-cloud auto-fulfillment, which lesson twenty-seven covers.

Choosing a protection

Time Travel is your self-service undo, for up to ninety days on Enterprise Edition. Fail-safe is Snowflake's last resort, for seven more days, through a support case. Cloning gives instant, writable copies, for tests or for a snapshot at a point in time. And replication with failover protects against the loss of a whole region.

Recap

Let's recap. Time Travel queries, clones, and restores data with AT, BEFORE, and UNDROP, within the retention period. Retention is one day by default, and up to ninety days for permanent objects on Enterprise Edition, with a minimum that ACCOUNTADMIN can enforce. Fail-safe adds seven days, for permanent objects, and only Snowflake can recover from it. Zero-copy clones share micro-partitions, until either side changes. And direct shares stay in one region, while listings and replication reach other regions.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. The intern’s update ran Friday at 6 p.m., and the catalog table keeps seven days of Time Travel. On Monday morning, what is the most precise way to get the catalog back as it was?

    • Clone it BEFORE the update’s statement ID
    • Run UNDROP TABLE on the catalog
    • Query it AT an offset of minus one hour
    • Open a Fail-safe case with Support
    Show the answer

    Clone it BEFORE the update’s statement ID

    A clone BEFORE the update statement returns the table exactly as it was before that statement ran. “Run UNDROP TABLE on the catalog” only restores a dropped table, and this table was never dropped. “Query it AT an offset of minus one hour” points to Monday morning, after the update, so the prices would still be zero. And “Open a Fail-safe case with Support” is for Snowflake's own recovery, once Time Travel has ended.

  2. Foxglove’s data scientists need a full, writable copy of the 40 TB production database to test a pricing model, without affecting production and with as little extra storage as possible. What fits best?

    • CREATE TABLE AS SELECT for every table
    • Replicate the database to a second account
    • Share the database with a reader account
    • Clone the production database
    Show the answer

    Clone the production database

    A clone is ready almost at once, it is writable, and it only adds storage for the data the scientists change. “CREATE TABLE AS SELECT for every table” copies every table in full, which costs storage and compute. “Replicate the database to a second account” creates a read-only secondary, in another account. And “Share the database with a reader account” gives read-only access, so the scientists could not change anything.

  3. Foxglove’s account administrator wants every database to keep at least seven days of Time Travel, even if a team sets zero days on its own tables. What should the administrator set?

    • DATA_RETENTION_TIME_IN_DAYS = 7 on the account
    • MIN_DATA_RETENTION_TIME_IN_DAYS = 7 on the account
    • Nothing: Fail-safe already keeps seven days
    • TRANSIENT on every new table
    Show the answer

    MIN_DATA_RETENTION_TIME_IN_DAYS = 7 on the account

    MIN_DATA_RETENTION_TIME_IN_DAYS enforces a minimum, and the higher value always wins. “DATA_RETENTION_TIME_IN_DAYS = 7 on the account” only sets a default, which each database, schema, or table can override. “Nothing: Fail-safe already keeps seven days” is for Snowflake's own recovery, so it gives users no Time Travel. And “TRANSIENT on every new table” would limit every table to one day at most.