Skip to main content
๐Ÿ“˜ Complete PDF

Snowflake Certification Practice Test 02

Practice Test 02

Question 1 of 20
๐Ÿ“‹ Multiple Choice
Question 21
A retail database administrator accidentally executes an unqualified DELETE statement: `DELETE FROM customers WHERE status = 'ACTIVE';` This erroneously purged 800,000 active customer records from an enterprise production table. Which Snowflake capability enables the team to recover these deleted records immediately without restoring from backup media?
A. Fail-safe Recovery Request
B. Zero-Copy Database Clone
โœ“
C. Time Travel
D. Search Optimization Service
Answer
โœ… C. Time Travel
Explanation

1. Concept Overview Snowflake **Time Travel** enables querying, restoring, and cloning data from historical points in time across a configurable retention window (0 to 90 days for Enterprise edition). It operates at the micro-partition metadata level, allowing instant recovery from accidental DML operations (DELETE, UPDATE, DROP) using the `AT` or `BEFORE` clauses.

2. Why the Correct Option is Right **Time Travel** allows the administrator to query the table as it existed immediately prior to the erroneous `DELETE` statement using the query ID (`BEFORE (statement => '<query_id>')`) or timestamp. The deleted records can be restored instantly using `INSERT INTO ... SELECT ... FROM ... BEFORE(...)` or by using `UNDROP TABLE`.

3. Why Other Options Are Incorrect - **Fail-safe Recovery Request:** Fail-safe is a non-configurable 7-day disaster recovery period accessible *only* by Snowflake Support after Time Travel expires. It cannot be queried directly by users and takes hours or days. - **Zero-Copy Database Clone:** While cloning is fast, cloning the *current* state of the table after the delete occurred will simply replicate the already-truncated table unless combined with Time Travel syntax. - **Search Optimization Service:** SOS accelerates point-lookup queries on large tables; it has no recovery or point-in-time historical rollback capabilities.

4. Production Scenario / Code Example

-- Step 1: Identify the Query ID of the accidental DELETE in Query History
-- Query ID: 01b45678-0001-2345-0000-12340001abcd

-- Step 2: Restore missing records directly from the point BEFORE the query executed
INSERT INTO production.customers
SELECT * 
FROM production.customers 
BEFORE (statement => '01b45678-0001-2345-0000-12340001abcd')
WHERE status = 'ACTIVE';

-- Alternatively, if the entire table was dropped:
-- UNDROP TABLE production.customers;

5. Real-World Architecture Context Because Snowflake micro-partitions are immutable, updating or deleting records does not overwrite physical blocks; it simply marks old micro-partitions as inactive and writes new ones. Time Travel works by reading the micro-partition pointers active at that historical timestamp.

6. Common Pitfalls & Anti-Patterns - **Relying on Time Travel for Transient/Temporary tables:** Transient tables have a maximum Time Travel retention of only 1 day and zero Fail-safe. - **Exceeding the retention period:** Once data ages past `DATA_RETENTION_TIME_IN_DAYS`, it moves to Fail-safe and cannot be restored by users.

7. Performance & Cost Considerations Retaining historical micro-partitions incurs standard cloud storage fees. For high-churn tables with millions of daily updates, setting retention to 90 days can substantially increase storage costs.

8. Exam / Interview Tip Remember: Standard edition supports 0 or 1 day of Time Travel. Enterprise edition supports 0 to 90 days on permanent tables. Transient and temporary tables are strictly limited to 0 or 1 day.

9. Key Takeaways - Time Travel recovers data from accidental DML operations using `AT` or `BEFORE`. - Operates at zero compute restore latency using immutable micro-partition metadata. - Configured via `DATA_RETENTION_TIME_IN_DAYS` (up to 90 days on Enterprise).

10. Related Tutorials & Resources - [Time Travel & Fail-Safe in Snowflake](/tutorials/snowflake/snowflake-time-travel-fail-safe) - [Zero-Copy Cloning in Snowflake](/tutorials/snowflake/snowflake-zero-copy-cloning)`

Answered: 0 / 20
Question Navigator (Test 02)0% Answered