Skip to content
  • AT SNOWFLAKE
  • Industry solutions
  • Partner & Customer Value
  • Product & Technology
  • Strategy & Insights
Languages
  • Deutsch
  • Français
  • Português
  • Español
  • English
  • Italiano
  • 日本語
  • 한국어
  • Deutsch
  • Français
  • Português
  • Español
  • English
  • Italiano
  • 日本語
  • 한국어
  • AT SNOWFLAKE
  • Industry solutions
  • Partner & Customer Value
  • Product & Technology
  • Strategy & Insights
  • Deutsch
  • Français
  • Português
  • Español
  • English
  • Italiano
  • 日本語
  • 한국어
  • 개요
    • Why Snowflake
    • 고객 사례
    • 파트너 네트워크
    • 서비스
  • 데이터 클라우드
    • 데이터 클라우드
    • 플랫폼 개요
    • SNOWFLAKE 데이터 마켓플레이스
    • Powered by Snowflake
    • 라이브 데모
  • WORKLOADS
    • 협업
    • 데이터 사이언스&머신러닝
    • 사이버 보안
    • 애플리케이션
    • 데이터 웨어하우스
    • 데이터 레이크
    • 데이터 엔지니어링
    • 유니스토어
  • PRICING
    • Pricing Options
  • 산업별 솔루션
    • 광고, 미디어 및 엔터테인먼트
    • 금융 서비스
    • 의료 및 생명 과학
    • 제조
    • 공공 부문
    • 소매 / CPG
    • 테크놀로지
  • 리소스
    • 리소스
    • Documentation
    • 핸즈온 랩
    • 트레이닝
  • CONNECT
    • Snowflake 블로그
    • 커뮤니티
    • 이벤트
    • 웨비나
    • 팟캐스트
  • 개요
    • 회사 소개
    • 투자정보
    • 리더십 및 이사회
    • 채용
Author
Saqib Mustafa
Share
Subscribe
2016년 03월 04일

Undrop a Table, Database or Schema

  • 제품 및 기술
    • 데이터 웨어하우스
    • 데이터 엔지니어링
Undrop a Table, Database or Schema

Hopefully you had a chance to read our previous posts #10, Query Results Sets available in history and #9 Ability to connect with JDBC, As promised in the original top 10 post, we continue the series with a deeper dive into another of the Top 10 cool features from Snowflake:

#8 UNDROP

Have you ever accidentally dropped a table? Maybe even a table with hundreds of millions of rows? Ouch. Or maybe someone ran the wrong script with a DROP in Production. And then you have to rush to the backup only to discover that the backup is 24 hours old! And then when you restore, it takes 3 times as long as it did to do the original backup, and even then the restored copy is 24 hours old.

UNDROP is a really cool feature in Snowflake that makes this so much easier to retrieve your data, because we store encrypted versions of the data and objects for 24 hours by default (with an option to purchase even longer retention periods if you need it).

With the UNDROP feature in Snowflake you can recover that lost data instantaneously with a single command:

UNDROP TABLE <tablename>

No need to reload last night’s backup to do the restore. No need to wait while all that data is pulled back in. No need to find the DBA who knows how to do it and has done it before.

It just happens!

In addition to UNDROP TABLE, we also have UNDROP SCHEMA and UNDROP DATABASE for when someone makes an even bigger goof (it really does happens – “really I thought I was logged into the dev database!”).

Again these are simple commands:

UNDROP SCHEMA <schema name>

UNDROP DATABASE <db name>

Both of these instantaneously restore all the objects that were previously dropped.  UNDROP SCHEMA recovers all the tables, views, and sequences that were in that schema.  While UNDROP DATABASE recovers all the schemas, tables, views, stages areas,  and sequences in that database.

For example: here is a sample  database history display (the result of running SHOW DATABASES HISTORY) that shows database SALES_DEV was dropped on 2/23/2016 at 8:49 AM. Oops.

Drop Database

Here is the history again after an we execute the command UNDROP DATABASE SALES_DEV using the Snowflake Web UI:

Undrop Database

In the Worksheet log you can see that the UNDROP was executed at 10:58 AM and took all of 591 milliseconds to execute. In the database history readout you can see that the “dropped_on” column now shows NULL for SALES_DEV indicating it is available for use again.

Very few databases allow you to UNDROP a table, schema or a database, this easily and quickly, using a simple SQL command prompt.

Now that is a huge time (and life) saver. Ask anyone who has dropped a production database or table by accident. And that is why it made the Top 10 list of really cool features in the Snowflake Elastic Data Warehouse.

As always, keep an eye on this blog site, our Snowflake Twitter feed (@SnowflakeDB), (@kentgraziano), and (@cloudsommelier), and our LinkedIn page for more Top 10 Cool Things About Snowflake and for updates on all the action and activities here at Snowflake Computing.

Kent Graziano and Saqib Mustafa

Share

Simplify DevOps with Fast Cloning

See how Snowflake fast cloning allows you to have multiple copies of your data without additional cost.

More Details
Read More

Using the Snowflake Information Schema

Snowflake has a data dictionary that we expose to users. We call it the Information Schema. This post will give you some...

More
Read More

Analytics for Games

Analytics for games has changed dramatically over the past 15 years. The advent of mobile gaming platforms has produced a flood of new data points and the need to update, personalize, and upsell th...

More to follow
Read More

Data Loading, ETL, and ELT

Traditionally, data loading was considered the act of copying and loading data from an application.

Learn More
Read More
Snowflake Inc.
  • 플랫폼 개요
    • 아키텍처
    • 데이터 애플리케이션
  • 데이터 마켓플레이스
  • Snowflake 파트너 네트워크
  • 지원 및 서비스
  • 회사
    • 문의하기

Sign up for Snowflake Communications

Thanks for signing up!

  • Privacy Notice
  • Site Terms
  • Cookie Settings

© 2023 Snowflake Inc. All Rights Reserved