Snowflake data retention and recovery rely on two mechanisms: Time Travel and Fail-safe. Time Travel lets users access past data directly, while Fail-safe is the final line of defense Snowflake holds internally after Time Travel expires.
This article walks through the timeline of both mechanisms, retention by edition, differences across table types, and the impact on storage cost. It is a frequently tested topic on the SnowPro Core exam under Domain 6 (Data Protection & Data Sharing / 10-15% of the exam).
Starting from the moment data is changed (UPDATE/DELETE/DROP), retention follows the timeline below.
データ変更発生
│
├── Time Travel期間(0〜90日)──────┐
│ ユーザーがAT/BEFORE句で │
│ 過去データに直接アクセス可能 │
│ UNDROP TABLE/SCHEMA/DATABASE │
│ で復元可能 │
│ │
├── Fail-safe期間(7日間)─────────┐
│ Snowflakeサポートによる │
│ データ復旧のみ可能 │
│ ユーザーは直接アクセス不可 │
│ │
└── データ完全消去 │
復旧不可能On Enterprise Edition (90-day Time Travel), data is protected for up to 97 days (90 + 7) after a change. On Standard Edition (Time Travel capped at 1 day), the maximum window is 8 days (1 + 7).
| Syntax | Purpose | Example |
|---|---|---|
| AT(TIMESTAMP => <ts>) | Query data as of a specific timestamp | AT(TIMESTAMP => '2026-03-25 10:00:00'::TIMESTAMP) |
| AT(OFFSET => <sec>) | Query data N seconds in the past | AT(OFFSET => -3600) for one hour ago |
| AT(STATEMENT => <id>) | Data as of a specific query execution | AT(STATEMENT => '8e5d0ca9-...') |
| BEFORE(STATEMENT => <id>) | Data immediately before a specific query | BEFORE(STATEMENT => '8e5d0ca9-...') |
Within the Time Travel window, tables, schemas, and databases dropped with DROP TABLE can be restored with UNDROP.
-- テーブルの復元
UNDROP TABLE sales;
-- スキーマの復元
UNDROP SCHEMA analytics;
-- データベースの復元
UNDROP DATABASE production;If an object with the same name already exists, UNDROP fails. You need to rename the existing object first with ALTER TABLE ... RENAME.
| Edition | Max Time Travel | Fail-safe Period | Total Max Protection |
|---|---|---|---|
| Standard | 0-1 days | 7 days | 8 days |
| Enterprise | 0-90 days | 7 days | 97 days |
| Business Critical | 0-90 days | 7 days | 97 days |
| VPS (Virtual Private Snowflake) | 0-90 days | 7 days | 97 days |
On Standard Edition, DATA_RETENTION_TIME_IN_DAYS is capped at 1 day. You need to upgrade to Enterprise or above to use the 90-day Time Travel window.
Snowflake has three table types (Permanent / Transient / Temporary), each with different retention behavior. The differences between these three are a frequent exam topic.
| Table Type | Time Travel | Fail-safe | Use Case | Storage Cost |
|---|---|---|---|---|
| Permanent (default) | 0-90 days (Enterprise+) | 7 days | Production data, master tables | Highest |
| Transient | 0-1 days | None (0 days) | Staging and intermediate tables | Low |
| Temporary | 0-1 days | None (0 days) | Per-session temporary work | Lowest |
Time Travel and Fail-safe retention directly affect storage cost. Retained data is stored as pre-change snapshots (delta data), so tables that change frequently accumulate more storage cost.
| Table Type | Time Travel = 90 days | Fail-safe | Storage Cost Impact |
|---|---|---|---|
| Permanent (10 GB table, full daily refresh) | Up to 10 GB × 90 days of deltas | 7 days of deltas | Very large |
| Transient (10 GB table, full daily refresh) | Up to 10 GB × 1 day of deltas | None | Small |
| Permanent (10 GB table, no updates) | 0 (no changes means no deltas) | 0 | None |
Setting 90-day Time Travel on a table with frequent UPDATEs and DELETEs can drive storage cost up sharply. Tune DATA_RETENTION_TIME_IN_DAYS based on each table's importance and update frequency.
DATA_RETENTION_TIME_IN_DAYS can be set at the account, database, schema, and table levels, with lower-level settings overriding higher-level ones.
-- アカウントレベル(デフォルト30日)
ALTER ACCOUNT SET DATA_RETENTION_TIME_IN_DAYS = 30;
-- ステージングスキーマ(0日 = Time Travel無効)
ALTER SCHEMA staging SET DATA_RETENTION_TIME_IN_DAYS = 0;
-- 重要テーブル(90日 = 最大保持)
ALTER TABLE master_customers SET DATA_RETENTION_TIME_IN_DAYS = 90;| Table Category | Recommended Time Travel | Table Type | Rationale |
|---|---|---|---|
| Master tables (customers, products) | 30-90 days | Permanent | Guarantee long recovery window after mistakes |
| Fact tables (sales, logs) | 7-30 days | Permanent | Cover recent operational mistakes |
| Staging tables | 0-1 days | Transient | Recoverable via reload; optimize cost |
| Intermediate aggregation tables | 0-1 days | Transient | Recoverable by re-running the calculation |
| Analytical scratch tables | 0 days | Temporary | Session-scoped; no retention needed |
SnowPro Core - Data Protection
問題 1
On an Enterprise Edition Snowflake account, which statement about data retention for Transient tables is correct?
正解: B
Even on Enterprise Edition, Transient tables are capped at 1 day of Time Travel (you cannot set 90 days like Permanent tables). Transient tables also have no Fail-safe period (0 days). This is the defining trait of Transient tables and is why they cost dramatically less to store than Permanent tables. Option A describes Permanent tables. Option C is wrong because Time Travel can be set anywhere from 0 to 1 day (1 day is allowed). Option D is wrong because Transient and Permanent tables have very different retention behavior.
What is the difference between Time Travel and Fail-safe?
Time Travel is a feature that lets users directly access and restore past data themselves using AT/BEFORE clauses. Enterprise edition and above allow up to 90 days of retention, and UNDROP TABLE/SCHEMA/DATABASE recoveries also operate within the Time Travel window. Fail-safe, on the other hand, is an internal Snowflake safety zone that protects data after Time Travel expires. During the 7-day Fail-safe period, you can recover data only by opening a ticket with Snowflake Support — users cannot access it directly. Fail-safe recovery can take hours to days and is positioned as a last resort.
Do Transient tables have Fail-safe?
No — Transient tables have no Fail-safe period (0 days). This is the defining trait of Transient tables and is what makes them dramatically cheaper to store than Permanent tables (which have 7 days of Fail-safe). Time Travel retention for Transient tables is 0-1 days on Standard Edition and 0-1 days on Enterprise and above (capped at 1 day). Permanent tables can have up to 90 days of Time Travel, but Transient tables are limited to 1 day even for Time Travel. Use Transient tables for ETL staging tables, intermediate tables, and other transient data that does not need recovery to optimize storage cost.
What are the default and maximum values of DATA_RETENTION_TIME_IN_DAYS?
DATA_RETENTION_TIME_IN_DAYS defaults to 1 day, which is the same across all editions. The maximum value depends on the edition: Standard Edition is fixed at 1 day (cannot be changed), while Enterprise and above support up to 90 days. The parameter can be set at the account, database, schema, and table levels, with lower-level settings overriding higher-level ones. For example, even if you set the account-level value to 30 days, you can disable retention on a specific staging table by setting it to 0. Longer retention increases storage cost, so choose a value that matches each table's importance.
Practice more Data Protection questions
Sharpen your understanding with questions from the Data Protection & Data Sharing domain
Try free questions →Related Snowflake Data Protection Articles
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Snowflake Certifications: All 11 Exams Explained (2026)
Every SnowPro certification — Associate, Core, Specialty, Ad...
Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)
All 11 SnowPro exams ranked by difficulty with study-time es...
Snowflake Study Guide: Fastest Pass Route by Exam (2026)
How to pass SnowPro certifications efficiently — official ma...
SnowPro Core (COF-C03): Complete Exam Guide (2026)
Pass the SnowPro Core exam — six domains, scope, sample ques...
SnowPro Associate Platform (SOL-C01): Complete Guide (2026)
The entry-level SnowPro Associate exam — scope, weighting, s...