Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Snowflake Cookbook

You're reading from   Snowflake Cookbook Techniques for building modern cloud data warehousing solutions

Arrow left icon
Product type Paperback
Published in Feb 2021
Publisher Packt
ISBN-13 9781800560611
Length 330 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Hamid Mahmood Qureshi Hamid Mahmood Qureshi
Author Profile Icon Hamid Mahmood Qureshi
Hamid Mahmood Qureshi
Hammad Sharif Hammad Sharif
Author Profile Icon Hammad Sharif
Hammad Sharif
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Chapter 1: Getting Started with Snowflake 2. Chapter 2: Managing the Data Life Cycle FREE CHAPTER 3. Chapter 3: Loading and Extracting Data into and out of Snowflake 4. Chapter 4: Building Data Pipelines in Snowflake 5. Chapter 5: Data Protection and Security in Snowflake 6. Chapter 6: Performance and Cost Optimization 7. Chapter 7: Secure Data Sharing 8. Chapter 8: Back to the Future with Time Travel 9. Chapter 9: Advanced SQL Techniques 10. Chapter 10: Extending Snowflake Capabilities 11. Other Books You May Enjoy

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:

  1. 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime