0% found this document useful (0 votes)
71 views8 pages

Snowflake - Time Travel

Time travel in Snowflake allows users to access data from a specific point in time, enhancing data recovery and reducing reliance on external teams. Recovery options include using offsets and timestamps, while limitations may arise if the data retention time is set to zero. The maximum time travel duration is 90 days for enterprise editions, and the UNDROP command can be used to recover dropped tables, schemas, and databases.

Uploaded by

Akash Kalwani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views8 pages

Snowflake - Time Travel

Time travel in Snowflake allows users to access data from a specific point in time, enhancing data recovery and reducing reliance on external teams. Recovery options include using offsets and timestamps, while limitations may arise if the data retention time is set to zero. The maximum time travel duration is 90 days for enterprise editions, and the UNDROP command can be used to recover dropped tables, schemas, and databases.

Uploaded by

Akash Kalwani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Time Travel

Sujith Nair
Cloud Data Architect
Snowflake Snowpro Certified
# What is time travel ? What are its advantages

Time travel is a feature of snowflake where it allows us to go back


to the state of data at a given point in time or before a query was
executed which updated the data.

The advantages are


• It has improved recovery time for data issues.
• Reduced dependency on external teams like DBA’s for recovery
• Eliminated explicit backup and recovery of data
# What are the different way/options you can use to
recover data with time travel?

AT OFFSET => -60*1.5


before (timestamp => ‘2024-04-15 17:47:50.581'::timestamp)
before (statement => '019b9ee5-0500-8473-0043-4d8300073062')
# A table has been TRUNCATED and you are not able
to recover it using time travel, what could be the
reason for the same?

This could be because the


DATA_RETENTION_TIME_IN_DAYS is set to 0
# A junior developer dropped a table, You have been
asked to recover it, how will you recover the table ?

We should use the UNDROP command to do so.


The DATA_RETENTION_TIME_IN_DAYS should be set to
a value of 1 or greater at the schema level.
# How will you find the data retention parameter for
a table?

We need to use the show parameters command

SHOW PARAMETERS like '%DATA_RETENTION_TIME_IN_DAYS%' in


table SIRIS.QA.CUSTOMER

We can update the value by using the command below

ALTER TABLE SIRIS.QA.CUSTOMERS


SET DATA_RETENTION_TIME_IN_DAYS=21;
# What is the max time travel available on any
edition of snowflake?

The max time travel is 90 days on enterprise edition and higher.


# Does the undrop command work with schema and
databases?

Yes, the undrop command works with schema and database in


addition to tables.

You might also like