Using Time Travel to recover from the accidental loss of table data
This recipe will go through a scenario of accidental data loss after a delete query has been executed, affecting data in a table. We will demonstrate how we can recover data after it has been deleted accidentally.
Getting ready
You will need to be connected to your Snowflake instance via the web UI or the SnowSQL client to execute this recipe.
How to do it…
We will be creating a table and populating that table with some sample data. Further on in the recipe, we will run DELETE
on this table and demonstrate how to recover to a point before the data was deleted. The steps for this recipe are as follows:
- We will create a new database, followed by creating a table containing some sample customer data. We will be using sample data provided by Snowflake to populate this table. To do so, run the following SQL:
CREATE DATABASE C8_R2; CREATE TABLE CUSTOMER AS SELECT * FROM SNOWFLAKE_SAMPLE_DATA.TPCDS_SF10TCL...