CREATE RESOURCE MONITOR

statementsupportedAccounts, users, sessions, warehouses

docs.snowflake.com ↗

Object: RESOURCE MONITOR

Creates a new resource monitor. This command can only be executed by account administrators.

Syntax

supportedpartialnot supportednot scored

CREATE [ OR REPLACE ] RESOURCE MONITOR [ IF NOT EXISTS ] <name> WITH
                      [ CREDIT_QUOTA = <number> ]
                      [ FREQUENCY = { MONTHLY | DAILY | WEEKLY | YEARLY | NEVER } ]
                      [ START_TIMESTAMP = { <timestamp> | IMMEDIATELY } ]
                      [ END_TIMESTAMP = <timestamp> ]
                      [ NOTIFY_USERS = ( <user_name> [ , <user_name> , ... ] ) ]
                      [ TRIGGERS triggerDefinition [ triggerDefinition ... ] ]

Where

triggerDefinition ::=
    ON <threshold> PERCENT DO { SUSPEND | SUSPEND_IMMEDIATE | NOTIFY }

Parameters

NameRequiredDescription
namerequiredIdentifier for the resource monitor; must be unique for your account. The identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object"). Identifiers enclosed in double quotes are also case-sensitive. For more details, see Identifier requirements.
CREDIT_QUOTA = numoptionalThe number of credits allocated to the resource monitor per frequency interval. When total usage for all warehouses assigned to the monitor reaches this number for the current frequency interval, the resource monitor is considered to be at 100% of quota. If a value is not specified for a resource monitor, the monitor has no quota and will never reach 100% usage within the specified interval. Default: No value (i.e. no credit quota)
FREQUENCY = MONTHLY | DAILY | WEEKLY | YEARLY | NEVERoptionalThe frequency interval at which the credit usage resets to 0. If you set a frequency for a resource monitor, you must also set START_TIMESTAMP. If you specify NEVER for the frequency, the credit usage for the warehouse does not reset. Default: No value (i.e. legacy behavior, whereby the credit quota resets at the beginning of each calendar month)
START_TIMESTAMP = timestamp | IMMEDIATELYoptionalThe date and time when the resource monitor starts monitoring credit usage for the assigned warehouses. If you set a timestamp for a resource monitor, you must also set FREQUENCY. If you specify IMMEDIATELY for the start timestamp, the current timestamp is used. If you specify a date without a time, the current time is used. If you set a time without specifying a time zone, UTC is used as the default time zone. Specify the timestamp as a string in one of these formats: 'YYYY-MM-DD', 'YYYY-MM-DD HH:MI', or 'YYYY-MM-DD HH:MI <time_zone>' (for example, '2026-10-15 13:30 PST'). Seconds aren’t supported; a value that includes seconds returns an invalid date/time format error. Default: No value (i.e. legacy behavior, whereby the resource monitor starts monitoring warehouses immediately)
END_TIMESTAMP = timestampoptionalThe date and time when the resource monitor suspends the assigned warehouses. Use the same timestamp formats as START_TIMESTAMP. Default: No value (i.e. no warehouse suspension date)
NOTIFY_USERS = ( user_name [ , user_name , ... ] )optionalSpecifies the list of users to receive email notifications on resource monitors. If a user identifier includes spaces or special characters or is case-sensitive, then the identifier must be enclosed in double quotes (e.g. “Mary Smith”). See Identifier requirements for details. The user identifier, user_name, is the value of the name column from the output of SHOW USERS. Each user listed must have a verified email address. For instructions on verifying email addresses in the web interface, see Verify your email address. Email notifications for non-administrator users do not supersede email notifications for administrators. Any account administrators that have enabled email notifications will continue to receive email notifications. Note The following limitations apply for non-administrator users: Non-administrator users can only receive notifications for warehouse monitors. Non-administrator users are notified by email but can’t see notifications in Snowsight. Non-administrator users can’t create resource monitors. Non-administrator users can’t assign other users to be notified.
TRIGGERS ... (aka actions)optionalSpecifies one or more triggers for the resource monitor. Each trigger definition consists of the following: Default: No value (i.e. resource monitor performs no actions)
ON threshold PERCENTA numeric value specified as a percentage of the credit quota for the resource monitor; values larger than 100 are supported. Once usage reaches this threshold for the current frequency interval, the trigger fires.
DO SUSPEND | SUSPEND_IMMEDIATE | NOTIFYSpecifies the action performed by the trigger when the threshold is reached: SUSPEND: Suspend all assigned warehouses while allowing currently running queries to complete. No new queries can be executed by the warehouses until the credit quota for the resource monitor is increased. In addition, this action sends a notification to all users who have enabled notifications for themselves. SUSPEND_IMMEDIATE: Suspend all assigned warehouses immediately and cancel any currently running queries or statements using the warehouses. In addition, this action sends a notification to all users who have enabled notifications for themselves. NOTIFY: Send a notification (to all account administrators with notifications enabled), but do not take any other action.

Usage notes

See also

Referenced by