A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/sql-reference/sql/create-replication-group below:

Website Navigation


CREATE REPLICATION GROUP | Snowflake Documentation

CREATE REPLICATION GROUP

Creates a new replication group of specified objects in the system.

For more information about using replication groups, see Introduction to replication and failover across multiple accounts.

This command can be used to:

See also:

ALTER REPLICATION GROUP , DROP REPLICATION GROUP , SHOW REPLICATION GROUPS

Syntax
CREATE REPLICATION GROUP [ IF NOT EXISTS ] <name>
    OBJECT_TYPES = <object_type> [ , <object_type> , ... ]
    [ ALLOWED_DATABASES = <db_name> [ , <db_name> , ... ] ]
    [ ALLOWED_SHARES = <share_name> [ , <share_name> , ... ] ]
    [ ALLOWED_INTEGRATION_TYPES = <integration_type_name> [ , <integration_type_name> , ... ] ]
    ALLOWED_ACCOUNTS = <org_name>.<target_account_name> [ , <org_name>.<target_account_name> , ... ]
    [ IGNORE EDITION CHECK ]
    [ REPLICATION_SCHEDULE = '{ <num> MINUTE | USING CRON <expr> <time_zone> }' ]
    [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ]
    [ ERROR_INTEGRATION = <integration_name> ]

Copy

Secondary Replication Group

CREATE REPLICATION GROUP [ IF NOT EXISTS ] <secondary_name>
    AS REPLICA OF <org_name>.<source_account_name>.<name>

Copy

Parameters
name

Specifies the identifier for the replication group. The identifier must start with an alphabetic character and cannot contain spaces or special characters unless the identifier string is enclosed in double quotes (for example, "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more details, see Identifier requirements.

OBJECT_TYPES = object_type [ , object_type , ... ]

Type(s) of objects for which you are enabling replication from the source account to the target account.

The following object types are supported:

ACCOUNT PARAMETERS:

Requires Business Critical Edition (or higher).

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 are included in the list of specified object types, the ALLOWED_DATABASES parameter must be set.

INTEGRATIONS:

Requires Business Critical Edition (or higher).

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.

NETWORK POLICIES:

Requires Business Critical Edition (or higher).

All network policies in the source account.

RESOURCE MONITORS:

Requires Business Critical Edition (or higher).

All resource monitors in the source account.

ROLES:

Requires Business Critical Edition (or higher).

All roles in the source account. Replicating roles implicitly includes all grants for object types included in the replication 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 are included in the list of specified object types, the ALLOWED_SHARES parameter must be set.

USERS:

Requires Business Critical Edition (or higher).

All users in the source account.

WAREHOUSES:

Requires Business Critical Edition (or higher).

All warehouses in the source account.

Note

If you replicate users and roles, programmatic access tokens for users are replicated automatically.

To modify the list of replicated object types to a specified target account, use ALTER REPLICATION GROUP to reset the list of object types.

ALLOWED_DATABASES = db_name [ , db_name , ... ]

Specifies the database or list of databases for which you are enabling replication from the source account to the target account. In order for you to set this parameter, the OBJECT_TYPES list must include DATABASES.

ALLOWED_SHARES = share_name [ , share_name , ... ]

Specifies the share or list of shares for which you are enabling replication from the source account to the target account. In order for you to set this parameter, the OBJECT_TYPES list must include SHARES.

ALLOWED_INTEGRATION_TYPES = integration_type_name [ , integration_type_name , ... ]

Requires Business Critical Edition (or higher).

Type(s) of integrations for which you are enabling replication 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:

ALLOWED_ACCOUNTS = org_name.target_account_name1 [ , org_name.target_account_name2 , ... ]

Specifies the target account or list of target accounts to which replication of specified objects from the source account is enabled.

org_name

Name of your Snowflake organization.

target_account_name

Target account to which you are enabling replication of the specified objects.

IGNORE EDITION CHECK

Allows replicating objects to accounts on lower editions in either of the following scenarios:

Both scenarios are prohibited by default in an effort to help prevent account administrators for Business Critical (or higher) accounts from inadvertently replicating sensitive data to accounts on lower editions.

REPLICATION_SCHEDULE ...

Specifies the schedule for refreshing secondary replication groups.

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 quota for objects.

ERROR_INTEGRATION = integration_name

Specifies the name of the notification integration to use to email/push notifications when refresh errors occur for the replication group. For more details, see Error notifications for replication and failover groups.

Secondary Replication Group Parameters

secondary_name

Specifies the identifier for the secondary replication group. The identifier must start with an alphabetic character and cannot contain spaces or special characters unless the identifier string is enclosed in double quotes (for example, "My object"). Identifiers enclosed in double quotes are also case-sensitive. For more details, see Identifier requirements.

The identifiers for the secondary replication group (secondary_name) and primary replication group (name) can be, but are not required to be, identical.

AS REPLICA OF org_name.source_account_name.name

Specifies the identifier of the primary replication group from which to create a secondary replication group.

org_name

Name of your Snowflake organization.

source_account_name

Source account from which you are enabling replication of the specified objects.

name

Identifier for the primary replication group in the source account.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

Privilege

Object

Notes

CREATE REPLICATION GROUP

Account

Only the ACCOUNTADMIN role has this privilege by default. The privilege can be granted to additional roles as needed.

MONITOR

Database

To add a database to a replication group, the active role must have the MONITOR privilege on the database.

OWNERSHIP

Share

To add a share to a replication group, the active role must have the OWNERSHIP privilege on the share.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes Examples Replicate a single database

Executed on the source account

Create a replication group named myrg in the source account to enable replication of database db1 from the source account to the myaccount2 account. Set the replication schedule to refresh the database every 10 minutes:

CREATE REPLICATION GROUP myrg
    OBJECT_TYPES = DATABASES
    ALLOWED_DATABASES = db1
    ALLOWED_ACCOUNTS = myorg.myaccount2
    REPLICATION_SCHEDULE = '10 MINUTE';

Copy

Executed on target account

Create a replication group in the target account as a replica of the replication group myrg in the source account:

CREATE REPLICATION GROUP myrg
    AS REPLICA OF myorg.myaccount1.myrg;

Copy

Replicate account objects

For examples of multiple database and account object replication, see the examples for CREATE FAILOVER GROUP.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4