USE ROLE accountadmin;
CREATE OR REPLACE RESOURCE MONITOR sample_rm
WITH
CREDIT_QUOTA = 100 -- 100 credits
FREQUENCY = monthly -- reset the monitor monthly
START_TIMESTAMP = immediately -- begin tracking immediately
TRIGGERS
ON 75 PERCENT DO NOTIFY -- notify accountadmins at 75%
ON 100 PERCENT DO SUSPEND -- suspend warehouse at 100 percent, let queries finish
ON 110 PERCENT DO SUSPEND_IMMEDIATE;
Credit Quota: Credit quota specifies the number of Snowflake credits allocated to the monitor for the specified frequency interval. Any number can be specified.
Frequency: The interval at which the used credits reset relative to the specified start date.
Start Timestamp: Date and time (i.e. timestamp) when the resource monitor starts monitoring the assigned warehouses.
Notify: Perform no action, but send an alert notification (to all account administrators with notifications enabled).
Notify & Suspend: Send a notification (to all account administrators with notifications enabled) and suspend all assigned warehouses after all statements being executed by the warehouse(s) have completed.
Notify & Suspend Immediate: Send a notification (to all account administrators with notifications enabled) and suspend all assigned warehouses immediately, which cancels any statements being executed by the warehouses at the time.
For further information on Snowflake Warehouses please visit the Working with Resource Monitors
To Apply The Resource Monitor to Our Warehouse:
ALTER WAREHOUSE Warehouse_name_wh SET RESOURCE_MONITOR = sample_rm;
For further information on Snowflake Warehouses please visit the Working with Resource Monitors