Skip to content

Instantly share code, notes, and snippets.

@vvgsrk
Created June 30, 2022 18:57
Show Gist options
  • Save vvgsrk/8877c933b22f575f5023826495dc1794 to your computer and use it in GitHub Desktop.
Save vvgsrk/8877c933b22f575f5023826495dc1794 to your computer and use it in GitHub Desktop.
Create a separate secondary database for refresh
-- A separate new database
CREATE DATABASE refresh_secondary_database;
-- Create a new schema
CREATE SCHEMA refresh_secondary_database.amadeus_dynamic_pricing;
-- Task that refreshes the secondary database on a schedule
CREATE OR REPLACE TASK refresh_secondary_database.amadeus_dynamic_pricing.dynamic_pricing_data_refresh_task
WAREHOUSE = WH01_XS
SCHEDULE = 'USING CRON 0 3 * * * UTC'
AS
ALTER DATABASE AMADEUS_DYNAMIC_PRICING REFRESH
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment