-- Create
CREATE DATABASE sales_db;
-- Clone (zero-copy)
CREATE DATABASE sales_dev_db CLONE sales_db;
-- Drop
DROP DATABASE IF EXISTS sales_dev_db;
-- Undrop (time travel recovery)
UNDROP DATABASE sales_dev_db;
-- Set data retention
ALTER DATABASE sales_db SET DATA_RETENTION_TIME_IN_DAYS = 30;
Creates a copy of the database that shares the underlying storage until changes are made. No additional storage cost for the clone until you modify data.
Create a share for secure data sharing between accounts:
CREATE SHARE sales_share;
GRANT USAGE ON DATABASE sales_db TO SHARE sales_share;
ALTER SHARE sales_share ADD ACCOUNTS = another_account;