Resetting a database in Snowflake recreates it from scratch, removing all schemas, tables, and data.
Teams reset databases to refresh development environments, clear test data, or rebuild schemas after major model changes. A clean slate ensures repeatable tests and prevents legacy objects from lingering.
Snowflake has no literal RESET DATABASE
statement. Instead, use CREATE OR REPLACE DATABASE
for an atomic drop-and-recreate or use DROP DATABASE … CASCADE
followed by CREATE DATABASE
for more control.
The command deletes the existing database (if present) and immediately recreates it with the same name. All previous schemas, tables such as Customers
, Orders
, and Products
disappear. Time-Travel history is lost unless DATA_RETENTION_TIME_IN_DAYS
is explicitly set.
Yes—use UNDROP DATABASE <db_name>
within your Time-Travel retention window. This restores the database and all dropped objects.
1️⃣ Back up critical objects with CREATE TABLE … CLONE
or COPY INTO @stage
. 2️⃣ Run CREATE OR REPLACE DATABASE ecommerce_dev
. 3️⃣ Recreate schemas and tables. 4️⃣ Reload seed data for Customers
, Orders
, and OrderItems
.
• Always confirm the target account & warehouse before executing.
• Snapshot vital tables to another database.
• Use ROLE
-based access control to limit who can run CREATE OR REPLACE
or DROP … CASCADE
.
All object-level grants vanish. Re-run your grant automation scripts or leverage Snowsight "Access History" to regenerate permissions.
No. The command deletes Time-Travel history unless you later restore with UNDROP DATABASE
during the retention window.
Yes, use CREATE OR REPLACE SCHEMA
or DROP SCHEMA … CASCADE
for targeted resets without touching the entire database.
Snowflake metadata operations are near-instant. Actual time is dominated by any reload scripts you run afterward.