ALTER ACCOUNT¶
Modifies an account. Can be used to modify any type of parameter (account, session, or object) at the account level. Also used to rename an account and to assign resource monitors and tags to an account. The command can only be executed by:
Account administrators (i.e. users with the ACCOUNTADMIN role) to set and unset:
Account parameters, which cannot be changed by any other users.
User, session, and object parameters, which serve as the parameter defaults for users, sessions, and the relevant objects. These defaults can be overridden at any time.
Resource monitors
Tags
Security administrators (i.e. users with the SECURITYADMIN role), or a higher role, to set and unset the NETWORK_POLICY account parameter.
Organization administrators (i.e. users with the ORGADMIN role) to rename an account and specify whether the original URL can be used to access the account.
Can also be used to specify a resource monitor for controlling credit usage for all virtual warehouses created in the account.
- For more information about setting parameters at the account level, see Parameter Management. For parameter details, see
Syntax¶
ALTER ACCOUNT SET { [ accountParams ] [ userParams ] [ objectParams ] [ sessionParams ] }
ALTER ACCOUNT UNSET <param_name> [ , ... ]
ALTER ACCOUNT SET RESOURCE_MONITOR = <monitor_name>
ALTER ACCOUNT SET { PASSWORD | SESSION } POLICY <policy_name>
ALTER ACCOUNT UNSET { PASSWORD | SESSION } POLICY
ALTER ACCOUNT SET TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]
ALTER ACCOUNT UNSET TAG <tag_name> [ , <tag_name> ... ]
ALTER ACCOUNT <account_name> RENAME TO <new_account_name> [ SAVE_OLD_URL = { TRUE | FALSE } ]
ALTER ACCOUNT <account_name> DROP OLD URL
Where:
accountParams ::= ALLOW_ID_TOKEN = TRUE | FALSE CLIENT_ENCRYPTION_KEY_SIZE = <integer> ENABLE_INTERNAL_STAGES_PRIVATELINK = TRUE | FALSE EXTERNAL_OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST = TRUE | FALSE INITIAL_REPLICATION_SIZE_LIMIT_IN_TB = <num> NETWORK_POLICY = <string> PERIODIC_DATA_REKEYING = TRUE | FALSE PREVENT_UNLOAD_TO_INLINE_URL = TRUE | FALSE PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE | FALSE REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION = TRUE | FALSE REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION = TRUE | FALSE SAML_IDENTITY_PROVIDER = <json_object> SSO_LOGIN_PAGE = TRUE | FALSEuserParams ::= ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR = TRUE | FALSEobjectParams ::= DATA_RETENTION_TIME_IN_DAYS = <integer> MAX_DATA_EXTENSION_TIME_IN_DAYS = <integer> DEFAULT_DDL_COLLATION = '<collation_specification>' MAX_CONCURRENCY_LEVEL = <num> NETWORK_POLICY = <string> PIPE_EXECUTION_PAUSED = TRUE | FALSE STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = <num> STATEMENT_TIMEOUT_IN_SECONDS = <num>sessionParams ::= ABORT_DETACHED_QUERY = TRUE | FALSE AUTOCOMMIT = TRUE | FALSE BINARY_INPUT_FORMAT = <string> BINARY_OUTPUT_FORMAT = <string> DATE_INPUT_FORMAT = <string> DATE_OUTPUT_FORMAT = <string> ERROR_ON_NONDETERMINISTIC_MERGE = TRUE | FALSE ERROR_ON_NONDETERMINISTIC_UPDATE = TRUE | FALSE JSON_INDENT = <num> LOCK_TIMEOUT = <num> QUERY_TAG = <string> ROWS_PER_RESULTSET = <num> SIMULATED_DATA_SHARING_CONSUMER = <string> STATEMENT_TIMEOUT_IN_SECONDS = <num> STRICT_JSON_OUTPUT = TRUE | FALSE TIMESTAMP_DAY_IS_ALWAYS_24H = TRUE | FALSE TIMESTAMP_INPUT_FORMAT = <string> TIMESTAMP_LTZ_OUTPUT_FORMAT = <string> TIMESTAMP_NTZ_OUTPUT_FORMAT = <string> TIMESTAMP_OUTPUT_FORMAT = <string> TIMESTAMP_TYPE_MAPPING = <string> TIMESTAMP_TZ_OUTPUT_FORMAT = <string> TIMEZONE = <string> TIME_INPUT_FORMAT = <string> TIME_OUTPUT_FORMAT = <string> TRANSACTION_DEFAULT_ISOLATION_LEVEL = <string> TWO_DIGIT_CENTURY_START = <num> UNSUPPORTED_DDL_ACTION = <string> USE_CACHED_RESULT = TRUE | FALSE WEEK_OF_YEAR_POLICY = <num> WEEK_START = <num>
Note
For readability, the complete list of session parameters that can be set for an account is not included here. For a complete list of all session parameters, with their descriptions, as well as account and object parameters, see Parameters.
Parameters¶
SET ...
Specifies one (or more) account, user, session, and object parameters to set for your account (separated by blank spaces, commas, or new lines):
Account parameters cannot be changed by any other users.
User, session, and object parameters set at the account level serve only as defaults and can be changed by other users.
For descriptions of the parameters you can set for your account, see Parameters.
UNSET ...
Specifies one (or more) account, session, and object parameters to unset for your account, which resets them to the system defaults.
You can reset multiple properties with a single ALTER statement; however, each property must be separated by a comma. When resetting a property, specify only the name; specifying a value for the property will return an error.
SET RESOURCE_MONITOR resource_monitor_name
Special parameter that specifies the name of the resource monitor used to control all virtual warehouses created in the account.
Important
Setting a resource monitor at the account level does not impact any of the Snowflake-provided warehouses that Snowflake uses for Snowpipe, automatic reclustering, or materialized views. The credits consumed by these warehouses do not count towards the credit quota for an account-level resource monitor.
For more details, see Working with Resource Monitors.
PASSWORD | SESSION POLICY policy_name
Specifies the password policy or the session policy to set for the account.
TAG tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ]
Specifies the tag name and the tag string value.
The tag value is always a string, and the maximum number of characters for the tag value is 256.
For details about specifying tags in a statement, refer to Tag Quotas for Objects & Columns.
RENAME TO new_account_name
Changes the name of an account to the specified name.
Organization administrators cannot rename an account while they are logged in to it, so they must log in to a different account before executing the ALTER ACCOUNT command. If your organization consists of a single account that needs to be renamed, contact Snowflake Support.
SAVE_OLD_URL
Optional parameter used in conjunction with
RENAME TO
that preserves the account URL used to access Snowflake prior to renaming. By default, Snowflake saves the original URL, which means you can access the account with either the old URL or the URL that contains the new account name. When set toFALSE
, you must use the new URL to access the account.- Default
TRUE
DROP OLD URL
Removes the original URL of an account that was renamed. Once the old URL is dropped, you must access the account with the URL that contains the new account name.
Usage Notes¶
Account parameters can be set only at the account level.
User, session, and object parameters that are set using this command serve only as defaults:
User parameters can be overridden at the individual user level.
Session parameters can be overridden at the individual user and session level.
Object parameters can be overridden at the individual object level.
Setting a resource monitor at the account level controls the credit usage for all virtual warehouses created in the account, but does not impact the credit usage for any of the Snowflake-provided warehouses. For more details, see Working with Resource Monitors.
Regarding metadata:
Attention
Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata Fields in Snowflake.
Examples¶
Associate a network policy named mypolicy
with your account:
ALTER ACCOUNT SET NETWORK_POLICY = mypolicy;
Remove the network policy association from your account:
ALTER ACCOUNT UNSET NETWORK_POLICY;