设置自动履行¶
本节介绍如何为安全共享数据产品和应用程序包数据产品设置 Cross-Cloud Auto-Fulfillment(自动履行)。还描述了如何为列表设置对象级自动履行。
您必须先将数据产品添加到您的列表中,然后才能设置自动履行。此外,设置自动履行的步骤会有所不同,具体取决于您提供的数据产品以及您如何提供列表。
设置对象级自动履行¶
您可以配置自动履行,以便将与列表相关的数据产品传输到其他 Snowflake 区域。您可以使用 SUB_DATABASE 自动履行,选择使用自动履行功能仅将数据产品中的表和视图履行到远程区域。这有助于降低成本并减轻自动履行数据产品的可管理性负担。
以下步骤描述了如何为列表设置对象级自动履行。作为典型工作流程的一部分,设置区域可用性(对于在 Snowflake Marketplace 上发布的列表)或添加位于另一个区域的使用者(对于私下共享的列表)时,您可以设置对象级自动履行。
创建列表。请参阅 创建新列表。
添加只包含受支持对象的数据产品。
设置与之共享的区域或账户,开始设置自动履行:
对于发布到 Snowflake Marketplace 的列表:
找到 Region Availability 部分并选择 Add。
对于 Region availability,保留 All regions 的默认值,或为您的列表选择 Custom regions。
对于私下共享的列表,可在远程区域添加一个使用者账户。
选择您偏好的刷新间隔,以更新远程区域的数据产品。
发布列表,或将其保存为草稿。
Set up auto-fulfillment for a listing that spans databases¶
Providers can create a single listing that spans databases, eliminating the need to create one combined database per listing. In this case, all listings associated with a database are auto-fulfilled together.
Workflow¶
A provider has a database (main database) that they want to share. They also have views in that database that reference objects in another database (referenced database).
The provider creates a share in the main database.
Using GRANT <privilege> ... SHARE, the provider grants the following required privileges to the share:
The provider grants the USAGE privilege on the main database that contains the view to the share.
The provider grants the REFERENCE_USAGE privilege on the referenced database to the share.
The provider grants the USAGE privilege on the schema that contains the view to the share.
The provider grants the SELECT privilege on the view to the share.
The provider creates a listing with the share and enables auto-fulfillment for cross-region cross-cloud consumers.
For more information, see 共享多个数据库中的数据.
Supported reference types¶
When REFERENCE_USAGE is granted on a database to a share, the following reference types are supported:
A view referencing a table or view in another database.
Tables or views with policies when these policies are stored in another database.
Tables or views with tags when these tags are stored in another database.
备注
A tag without an attached policy in a different database will only be replicated if reference usage is granted. Otherwise, replication will be skipped. See GRANT <privilege> ... SHARE for more information. If the tag is used in tag-based masking, then the share is treated as a table or view with row-access policies.
Limitations¶
Snowflake groups listings together when refreshing the data. Setting up listings that span multiple databases can change the way listings are grouped. As a result, the following might be affected:
The listing refresh history can be missing or incorrect after update the auto-fulfillment schedule.
Setting the
refresh_schedule_overrideoption may be required. When this option is missing, a resulting error message will include the list of listings that were affected by the change in the way listings were grouped.
Usage notes¶
When setting up auto-fulfillment, if the selected and referenced databases include existing listings, then the values in the Data product refresh section default to the existing refresh schedule. As a result, changes to the auto-fulfillment refresh schedule apply to all other listings associated with this database and with the referenced database.
Examples¶
For examples on how to create a secure view that references objects and other views in one or more databases, see the Share data from multiple databases examples.
After you create a secure view, you can create a listing that includes the secure view and set up auto-fulfillment on the listing. For examples on how to create listings on the Snowflake Marketplace, see Create and publish a listing.