ALTER FAILOVER GROUP

statementsupportedReplication, failover & backupBusiness Critical+

docs.snowflake.com ↗

Object: FAILOVER GROUP

Modifies the properties for an existing failover group. From the source account, you can perform the following actions: - Rename the failover group. - Reset the list of specified object types enabled for replication and failover. - Set or update the replication schedule for automatic refresh of secondary failover groups. - Add or remove account objects of the following types to or from a failover group: Databases - External volumes - Shares - Security integrations - API integrations - Storage integrations - External access integrations - Certain types of notification integrations (see Integration replication) - Add or remove target accounts enabled for replication and failover. - Move shares or databases to another failover group. - Enable or disable Optimized Refresh or RPO Assurance. From the target account, you can perform the following actions: - Refresh objects in the target account from the source account. - Promote a secondary failover group to primary (that is, fail over the failover group of objects). - Suspend scheduled replication. - Resume scheduled replication.

Syntax

supportedpartialnot supportednot scored

Source Account

ALTER FAILOVER GROUP [ IF EXISTS ] <name> RENAME TO <new_name>

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  [ OBJECT_TYPES = <object_type> [ , <object_type> , ... ] ]
  [ ALLOWED_DATABASES = <db_name> [ , <db_name> , ... ] ]
  [ ALLOWED_EXTERNAL_VOLUMES = <external_volume_name> [ , <external_volume_name> , ... ] ]
  [ ALLOWED_SHARES = <share_name> [ , <share_name> , ... ] ]

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  OBJECT_TYPES = INTEGRATIONS [ , <object_type> , ... ]
  ALLOWED_INTEGRATION_TYPES = <integration_type_name> [ , <integration_type_name> ... ]

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  COMMENT = '<string_literal>'

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  REPLICATION_SCHEDULE = '{ <num> MINUTE | USING CRON <expr> <time_zone> }'

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  OPTIMIZED_REFRESH = { TRUE | FALSE }

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  RPO_ASSURANCE = { TRUE | FALSE }

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  ERROR_INTEGRATION = <integration_name>

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  READ_ONLY = TRUE

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SET
  TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]

ALTER FAILOVER GROUP [ IF EXISTS ] <name> UNSET
  { COMMENT | REPLICATION_SCHEDULE | OPTIMIZED_REFRESH | RPO_ASSURANCE | ERROR_INTEGRATION | READ_ONLY } [ , ... ]

ALTER FAILOVER GROUP [ IF EXISTS ] <name> UNSET
  TAG <tag_name> [ , <tag_name> ... ]

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  ADD <db_name> [ , <db_name> ,  ... ] TO ALLOWED_DATABASES

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  MOVE DATABASES <db_name> [ , <db_name> ,  ... ] TO FAILOVER GROUP <move_to_fg_name>

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  REMOVE <db_name> [ , <db_name> ,  ... ] FROM ALLOWED_DATABASES

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  ADD <external_volume_name> [ , <external_volume_name> ,  ... ] TO ALLOWED_EXTERNAL_VOLUMES

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  MOVE EXTERNAL VOLUMES <external_volume_name> [ , <external_volume_name> ,  ... ] TO FAILOVER GROUP <move_to_fg_name>

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  REMOVE <external_volume_name> [ , <external_volume_name> ,  ... ] FROM ALLOWED_EXTERNAL_VOLUMES

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  ADD <share_name> [ , <share_name> ,  ... ] TO ALLOWED_SHARES

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  MOVE SHARES <share_name> [ , <share_name> ,  ... ] TO FAILOVER GROUP <move_to_fg_name>

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  REMOVE <share_name> [ , <share_name> ,  ... ] FROM ALLOWED_SHARES

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  ADD <org_name>.<target_account_name> [ , <org_name>.<target_account_name> ,  ... ] TO ALLOWED_ACCOUNTS
  [ IGNORE EDITION CHECK ]

ALTER FAILOVER GROUP [ IF EXISTS ] <name>
  REMOVE <org_name>.<target_account_name> [ , <org_name>.<target_account_name> ,  ... ] FROM ALLOWED_ACCOUNTS

Target Account

ALTER FAILOVER GROUP [ IF EXISTS ] <name> REFRESH

ALTER FAILOVER GROUP [ IF EXISTS ] <name> PRIMARY

ALTER FAILOVER GROUP [ IF EXISTS ] <name> SUSPEND [ IMMEDIATE ]

ALTER FAILOVER GROUP [ IF EXISTS ] <name> RESUME

Parameters

NameRequiredDescription
nameSpecifies the identifier for the failover group.
RENAME TO new_name
  • new_name — Specifies the new identifier for the failover group. The new identifier cannot be used if the identifier is already in place for a different replication or failover group. For more details, see Identifier requirements.
SET ...Specifies properties to set for the failover group (separated by blank spaces, commas, or new lines). Note If the ALLOWED_DATABASES, ALLOWED_EXTERNAL_VOLUMES, or ALLOWED_SHARES lists are modified, any objects that were previously in the list and removed will be dropped in any target account with a linked secondary failover group when the next refresh operation occurs.
OBJECT_TYPES = object_type [ , object_type , ... ]Reset the list of object types for which you are enabling replication and failover from the source account to target account(s). Note For database, external volume, and share objects: If DATABASES, EXTERNAL VOLUMES, or SHARES are included in the OBJECT_TYPES list, and remain in the OBJECT_TYPES list after the list is reset, the respective allowed objects list (ALLOWED_DATABASES, ALLOWED_EXTERNAL_VOLUMES, or ALLOWED_SHARES) remains unchanged. If the OBJECT_TYPES list is reset to add or remove DATABASES, the ALLOWED_DATABASES list is set to NULL. If the OBJECT_TYPES list is reset to add or remove EXTERNAL VOLUMES, the ALLOWED_EXTERNAL_VOLUMES list is set to NULL. If the OBJECT_TYPES list is reset to add or remove SHARES, the ALLOWED_SHARES list is set to NULL. Use the ADD, MOVE, and REMOVE clauses to modify the list of allowed database, external volume, or share objects. The following object types are supported: ACCOUNT PARAMETERS: All account-level parameters. This includes account parameters and parameters that can be set for your account. DATABASES: Add database objects to the list of object types. If database objects were already included in the list of specified object types, the ALLOWED_DATABASES list remains unchanged. To modify the list of databases, use the ADD, MOVE, or REMOVE clauses. EXTERNAL VOLUMES: Add external volume objects to the list of object types. If external volume objects are included in the list of specified object types, the ALLOWED_EXTERNAL_VOLUMES parameter must be set. To modify the list of external volumes, use the ADD, MOVE, or REMOVE clauses. INTEGRATIONS: Currently, only security, API, storage, external access, and certain types of notification integrations are supported. For details, see Integration replication. If integration objects are included in the list of specified object types, the ALLOWED_INTEGRATION_TYPES parameter must be set. LISTINGS: Add listings to the list of object types. When adding listings to a failover group, adding shares is optional. Snowflake automatically selects all of the eligible listings and their shares for replication and failover. NETWORK POLICIES: All network policies in the source account. PROFILES: All profiles in the source account. Review profile replication constraints for information about current constraints. RESOURCE MONITORS: All resource monitors in the source account. ROLES: All roles in the source account. Replicating roles implicitly includes all grants for object types included in the failover group. For example, if ROLES is the only object type that is replicated, then only hierarchies of roles (that is, roles granted to other roles) are replicated to target accounts. If the USERS object type is also included, then role grants to users are also replicated. SHARES: Add share objects to the list of object types. If share objects were already included in the list of specified object types, the ALLOWED_SHARES list remains unchanged. To modify the list of shares, use the ADD, MOVE, or REMOVE clauses. USERS: All users in the source account. WAREHOUSES: All warehouses in the source account. Note If you replicate users and roles, programmatic access tokens for users are replicated automatically.
ALLOWED_DATABASES = db_name [ , db_name , ... ]Specifies the database or list of databases for which you are enabling replication and failover from the source account to the target account. In order for you to set this parameter, the OBJECT_TYPES list must include DATABASES.
  • db_name — Specifies the identifier for the database.
ALLOWED_EXTERNAL_VOLUMES = external_volume_name [ , external_volume_name , ... ]Preview Feature — Open Available to all accounts. Specifies the external volume or list of external volumes for which you are enabling replication and failover from the source account to the target account. For you to set this parameter, the OBJECT_TYPES list must include EXTERNAL VOLUMES.
  • external_volume_name — Specifies the identifier for the external volume.
ALLOWED_SHARES = share_name [ , share_name , ... ]Specifies the share or list of shares for which you are enabling replication and failover from the source account to the target account. For you to set this parameter, the OBJECT_TYPES list must include SHARES.
  • share_name — Specifies the identifier for the share.
ALLOWED_INTEGRATION_TYPES = integration_type_name [ , integration_type_name , ... ]Type(s) of integrations for which you are enabling replication and failover from the source account to the target account. This property requires that the OBJECT_TYPES list include INTEGRATIONS to set this parameter. The following integration types are supported: SECURITY INTEGRATIONS: Specifies security integrations. This property requires that the OBJECT_TYPES list include ROLES. API INTEGRATIONS: Specifies API integrations. API integration replication requires additional set up after the API integration is replicated to the target account. For more information, see Updating the remote service for API integrations. STORAGE INTEGRATIONS: Specifies storage integrations. EXTERNAL ACCESS INTEGRATIONS: Specifies external access integrations. For more information, see Replication of stored procedures and user-defined functions (UDFs). NOTIFICATION INTEGRATIONS: Specifies notification integrations. Only some types of notification integrations are replicated. For details, see Integration replication.
COMMENT = 'string_literal'Adds a comment or overwrites an existing comment for the failover group. Default: NULL
REPLICATION_SCHEDULE ...Specifies the schedule for refreshing secondary failover groups. USING CRON expr time_zone Specifies a cron expression and time zone for the secondary group refresh. Supports a subset of standard cron utility syntax. For a list of time zones, see the list of tz database time zones (in Wikipedia). The cron expression consists of the following fields: # __________ minute (0-59) # | ________ hour (0-23) # | | ______ day of month (1-31, or L) # | | | ____ month (1-12, JAN-DEC) # | | | | __ day of week (0-6, SUN-SAT, or L) # | | | | | # | | | | | * * * * * The following special characters are supported: * Wildcard. Specifies any occurrence of the field. L Stands for “last”. When used in the day-of-week field, it allows you to specify constructs such as “the last Friday” (“5L”) of a given month. In the day-of-month field, it specifies the last day of the month. /n Indicates the nth instance of a given unit of time. Each quanta of time is computed independently. For example, if 4/3 is specified in the month field, then the refresh is scheduled for April, July and October (i.e. every 3 months, starting with the 4th month of the year). The same schedule is maintained in subsequent years. That is, the refresh is not scheduled to run in January (3 months after the October run). Note The cron expression currently evaluates against the specified time zone only. Altering the TIMEZONE parameter value for the account (or setting the value at the user or session level) does not change the time zone for the refresh. The cron expression defines all valid run times for the refresh. Snowflake attempts to refresh secondary groups based on this schedule; however, any valid run time is skipped if a previous run has not completed before the next valid run time starts. When both a specific day of month and day of week are included in the cron expression, then the refresh is scheduled on days satisfying either the day of month or day of week. For example, SCHEDULE = 'USING CRON 0 0 10-20 * TUE,THU UTC' schedules a refresh at 0AM on any 10th to 20th day of the month and also on any Tuesday or Thursday outside of those dates. num MINUTE Specifies an interval (in minutes) of wait time between refreshes. Accepts positive integers only. Also supports num M syntax. To avoid ambiguity, a base interval time is set: When the object is created (using CREATE <object>) or When a different interval is set (using ALTER <object> … SET REPLICATION_SCHEDULE) The base interval time starts the interval counter from the current clock time. For example, if an INTERVAL value of 10 is set and the scheduled refresh is enabled at 9:03 AM, then the refresh runs at 9:13 AM, 9:23 AM, and so on. Note that we make a best effort to ensure absolute precision, but only guarantee that refreshes do not execute before their set interval occurs (e.g. in the current example, the refresh could first run at 9:14 AM, but will definitely not run at 9:12 AM). Note The maximum supported value is 11520 (8 days). If the replication schedule has a greater num MINUTE value, the refresh operation never runs. Default: NULL
OPTIMIZED_REFRESH = { TRUE | FALSE }Enables or disables Optimized Refresh for the failover group. Optimized Refresh tracks metadata changes on the source account and applies only those changes to the target account on each refresh, so refresh duration scales with the rate of change rather than the total size of your environment. When set to TRUE: A REPLICATION_SCHEDULE is required, and the schedule interval must be no more than 6 hours. You can set or update the schedule in the same ALTER statement. For best results, Snowflake recommends a schedule of 10 MINUTE or less. The property can be set on the primary failover group only. The next refresh after enabling is a one-time bootstrapping refresh that establishes the baseline. Subsequent refreshes are incremental. The bootstrapping refresh is billed under the Optimized Refresh pricing model. The Optimized Refresh pricing model applies for all refreshes while this property is TRUE. For details, see Pricing for Optimized Refresh and RPO Assurance. To revert to Replication Classic, use the UNSET form (see the UNSET ... description below). The next refresh runs as Replication Classic and is billed under Replication Classic compute pricing. You can’t set OPTIMIZED_REFRESH = TRUE on a failover group that has RPO_ASSURANCE = TRUE. RPO Assurance enables Optimized Refresh automatically and manages the refresh schedule for you. Default: FALSE
RPO_ASSURANCE = { TRUE | FALSE }Enables or disables RPO Assurance for the failover group. When enabled, Snowflake manages continuous replication refreshes to keep secondary accounts in sync with the primary. Enabling the feature doesn’t by itself mean the pair is covered by the SLA. For the current RPO target, and when it is backed by a service-level agreement (SLA), see SLA eligibility and coverage. When set to TRUE: The failover group must not have a REPLICATION_SCHEDULE set. Unset the schedule before enabling RPO Assurance. Optimized Refresh is enabled automatically. You don’t need to set OPTIMIZED_REFRESH yourself. The property can be set on the primary failover group only. Continuous refreshes begin immediately on secondary accounts that aren’t suspended. Billing uses the RPO Assurance rates. For details, see Pricing for Optimized Refresh and RPO Assurance. To disable RPO Assurance, use the UNSET form (see the UNSET ... description below). Continuous refreshes stop, and you can set a REPLICATION_SCHEDULE if needed. A pair isn’t covered by the SLA while RPO Assurance is disabled. Default: FALSE
ERROR_INTEGRATION = integration_nameSpecifies the name of the notification integration to use to email/push notifications when refresh errors occur for the failover group. For more details, see Error notifications for replication and failover groups.
READ_ONLY = TRUEPuts the primary failover group into read-only mode. Use read-only mode to stop new writes to objects in the failover group on the source account during a planned disaster recovery drill or account migration. For the workflow, see Quiesce a primary failover group. You can set this property on the primary failover group only. The active role needs the OWNERSHIP privilege or the FAILOVER privilege on the failover group. When read-only mode is set: New DDL and DML statements that target objects in the failover group fail. Tasks, pipes, and alerts whose database is in the failover group aren’t scheduled. Read operations (SELECT, SHOW, and DESCRIBE) continue to work. To restore read-write mode without failing over, unset READ_ONLY. After you promote the failover group on the target account, the source becomes a secondary and READ_ONLY is cleared. Default: FALSE
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 information about specifying tags in a statement, see Tag quotas.
ADD db_name [ , db_name , ... ] TO ALLOWED_DATABASESSpecifies a comma-separated list of additional databases to enable for replication and failover. To add databases, DATABASES must be included in the list of specified object types. If the list of object types does not already include DATABASES, you must add it.
  • db_name — Specifies the identifier for the database.
MOVE DATABASES db_name [ , db_name , ... ] TO FAILOVER GROUP move_to_fg_nameSpecifies a comma-separated list of databases to move from one failover group to another failover group. The failover group the databases are being moved to must include DATABASES in the list of specified object types.
  • db_name — Specifies the identifier for the database.
  • move_to_fg_name — Specifies the identifier for the failover group the databases are being moved to.
REMOVE db_name [ , db_name , ... ] FROM ALLOWED_DATABASESSpecifies a comma-separated list of databases to remove from the list of databases enabled for replication and failover. Note When you remove a database from a primary failover group, the database is dropped in any target account with a linked secondary failover group when the next refresh operation occurs. To avoid dropping databases in the target account, you can drop the secondary failover group before the next time the modified primary failover group is replicated to the target account. When you drop the secondary failover group, read-only secondary databases that were included in the group become standalone read-write databases in the target account.
ADD external_volume_name [ , external_volume_name , ... ] TO ALLOWED_EXTERNAL_VOLUMESSpecifies a comma-separated list of additional external volumes to enable for replication and failover. To add external volumes, EXTERNAL VOLUMES must be included in the list of specified object types. If the list of object types does not already include EXTERNAL VOLUMES, you must add it.
  • external_volume_name — Specifies the identifier for the external volume.
MOVE EXTERNAL VOLUMES external_volume_name [ , external_volume_name , ... ] TO FAILOVER GROUP move_to_fg_nameSpecifies a comma-separated list of external volumes to move from one failover group to another failover group. The failover group the external volumes are being moved to must include EXTERNAL VOLUMES in the list of specified object types.
  • db_name — Specifies the identifier for the external volume.
  • move_to_fg_name — Specifies the identifier for the failover group the external volumes are being moved to.
REMOVE external_volume_name [ , external_volume_name , ... ] FROM ALLOWED_EXTERNAL_VOLUMESSpecifies a comma-separated list of external volumes to remove from the list of external volumes enabled for replication and failover. Note When you remove an external volume from a primary failover group, the external volume is dropped in any target account with a linked secondary failover group when the next refresh operation occurs. To avoid dropping external volumes in the target account, you can drop the secondary failover group before the next time the modified primary failover group is replicated to the target account. When you drop the secondary failover group, read-only secondary external volumes that were included in the group become standalone read-write external volumes in the target account.
ADD share_name [ , share_name , ... ] TO ALLOWED_SHARESSpecifies a comma-separated list of additional shares to enable for replication and failover. To add shares, SHARES must be included in the list of specified object types. If the list of object types doesn’t already include SHARES, you must add it.
  • share_name — Specifies the identifier for the share.
MOVE SHARES share_name [ , share_name , ... ] TO FAILOVER GROUP move_to_fg_nameSpecifies a comma-separated list of shares to move from one failover group to another failover group. The failover group the shares are being moved to must include SHARES in the list of specified object types.
  • share_name — Specifies the identifier for the share.
  • move_to_fg_name — Specifies the identifier for the failover group the shares are being moved to.
REMOVE share_name [ , share_name , ... ] FROM ALLOWED_SHARESSpecifies a comma-separated list of shares to remove from the list of shares enabled for replication and failover. Note When you remove a share from a primary failover group, the share is dropped in any target account with a secondary failover group when the next refresh operation occurs.
ADD org_name.target_account_name [ , org_name.target_account_name , ... ] TO ALLOWED_ACCOUNTSSpecifies a comma-separated list of target accounts to add to the primary failover group to enable replication and failover of specified objects in the source account to the target account. Secondary failover groups in the target accounts in this list can be promoted to serve as the primary failover group in case of failover.
  • org_name — Name of your Snowflake organization.
  • target_account_name — Target account to which you are enabling replication of the specified objects.
REMOVE org_name.target_account_name [ , org_name.target_account_name , ... ] FROM ALLOWED_ACCOUNTSSpecifies a comma-separated list of target accounts to remove from the primary failover group to disable replication of specified objects in the source account to the target account. Removing a target account disables failover from the current account to this target account.
  • org_name — Name of your Snowflake organization.
  • target_account_name — Target account to which you are disabling replication of the specified objects.
nameSpecifies the identifier for the failover group.
REFRESHRefreshes the objects in the target (current) account from the source account.
PRIMARYPromote a secondary failover group and its specified objects in the target (current) account to primary (in case of failover).
SUSPEND [ IMMEDIATE ]Suspend the scheduled refresh of the secondary failover group (if the primary failover group has scheduled refreshes using the REPLICATION_SCHEDULE property). The optional IMMEDIATE keyword cancels a scheduled refresh operation that is currently in progress for the secondary failover group (if there is one). Note that there might be a slight delay between the time that the statement returns and the time that the cancellation of the refresh operation is finished.
RESUMEResume scheduled refresh of the secondary failover group (if the primary failover group has scheduled refreshes using the REPLICATION_SCHEDULE property).
UNSET ...Specifies one (or more) properties to unset for the failover group, which resets them to the defaults: COMMENT REPLICATION_SCHEDULE OPTIMIZED_REFRESH RPO_ASSURANCE ERROR_INTEGRATION READ_ONLY TAG tag_name [ , tag_name ... ] You can reset multiple properties with a single ALTER statement; however, each property must be separated by a comma. Also, when resetting a property, you only specify the name; no value is required.

Usage notes

See also

Referenced by