Snowflake Data Clean Rooms:管理员任务¶
This topic describes the tasks for the administrator of a Snowflake Data Clean Room. For information about installing the clean room environment in your Snowflake account, see 安装 Snowflake Data Clean Rooms 环境.
Updating the clean rooms environment¶
Snowflake Data Clean Rooms updates their binaries weekly to support new features, procedures and UI updates. You can find release notes for significant new releases in the feature updates section of the Snowflake release notes page (search for "clean rooms").
Clean rooms UI updates¶
The clean rooms UI environment is updated automatically by Snowflake; all users need to do to get the updated version is sign out and sign back in to the clean rooms UI.
Clean rooms API updates¶
A clean rooms administrator can either enable automatic API updates (recommended) or update the API environment manually for each new release, as described next.
Automatic API updates¶
A clean rooms API administrator can enable clean rooms updates to be installed automatically upon release by running the following SQL commands once in their account:
USE ROLE SAMOOHA_APP_ROLE;
CALL SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.library.enable_local_db_auto_upgrades();
Clean rooms API users in that account will see the updates shortly when they are rolled out, without needing to log out.
Manual API updates¶
We recommend enabling automatic clean room updates for your account. But if you prefer to update your account's API environment manually, you can do so by running the following SQL commands each time you want to update the environment:
USE ROLE SAMOOHA_APP_ROLE;
CALL SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.library.apply_patch();
You can find your release number by running the following SQL command:
SELECT * FROM SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.ADMIN.VERSION;
Using a different warehouse¶
Clean rooms come with several warehouses that can access the API. Choose the warehouse that is appropriate for your needs. You can also choose a custom warehouse size for specific actions, such as for provider activation.
However, your clean room can use any warehouse you choose, if you grant USAGE and OPERATE privileges on that warehouse to the SAMOOHA_APP_ROLE role.
例如,要添加一个可以用于运行分析的仓库 my_big_warehouse,请通过工作表执行以下命令:
USE ROLE ACCOUNTADMIN;
CREATE WAREHOUSE my_big_warehouse WITH WAREHOUSE_SIZE = X5LARGE;
GRANT USAGE, OPERATE ON WAREHOUSE my_big_warehouse TO ROLE SAMOOHA_APP_ROLE;
监控 Clean Room UI 活动¶
管理员可以监控 Snowflake 账户中的查询历史记录,以跟踪用户在 Clean Room UI 中执行的操作。您可以识别与 Clean Room UI 中的活动对应的查询历史记录条目,因为 user_name 的值是 配置 Snowflake 账户 时创建的服务用户的名称。
您可以使用 user_email 查询标签来识别哪个 Clean Room 用户执行了操作。
要访问 Clean Room 环境的查询历史记录,请根据是要使用 SQL 还是 Snowsight 来执行以下过程之一:
- Snowsight:
以具有 ACCOUNTADMIN 角色的用户身份登录与您的 Clean Room 环境关联的 Snowflake 账户。
In the navigation menu, select Monitoring » Query History.
使用 User 筛选器选择与 Clean Room 环境关联的服务账户用户。
- SQL:
对共享的 SNOWFLAKE 数据库的 ACCOUNT_USAGE 架构中的 QUERY_HISTORY 视图 执行查询。
例如,如果要跟踪用户
joe@example.com的 Clean Room UI 活动,请执行以下代码:SELECT *, TRY_PARSE_JSON(query_tag) AS query_tag_details FROM snowflake.account_usage.query_history WHERE query_tag_details IS NOT NULL AND query_tag_details:request_type = 'DCR' AND query_tag_details:user_email = 'joe@example.com';
监控由提供商运行的分析¶
提供者运行的分析是指提供者创建并共享 Clean Room 的过程,在使用者链接他们的数据后,在 Clean Room 中进行分析。这些分析在使用者的账户中运行,而不是在提供者的账户中。本节描述了使用者如何在 Clean Room 中跟踪由提供者分析执行的查询。
Snowflake Data Clean Rooms 为每个执行的查询分配一个查询标签,以进行提供者运行的分析。该查询标签的形式为 cleanroom_UUID_provider_account_locator。消费者可以通过在其账户的查询历史中搜索查询标签,检索与提供商运行的分析相关的所有查询。
要检索查询,首先获取 Clean Room 的 UUID,然后搜索查询标签。在以下代码中,将 cleanroom_name 和 provider_account_locator 替换为适当的值。
-- Retrieve clean room UUID
SELECT cleanroom_id FROM samooha_by_snowflake_local_db.public.cleanroom_record
WHERE cleanroom_name = '<cleanroom_name>';
-- Retrieve queries with provider-run query tag
SELECT * FROM snowflake.account_usage.query_history
WHERE query_tag = cleanroom_id || '<provider_account_locator>;
您还可以使用 Snowsight,在使用 SQL 检索 Clean Room UUID 后,通过适当的查询标签过滤查询历史。
自定义可用连接器¶
您可以使用连接器将 Clean Room 环境与生态系统合作伙伴集成到一起。作为提供商的 Clean Room 管理员,您可以自定义 Clean Room 环境,以限制哪些连接器作为 Clean Room 用户的选项出现。例如,如果您有一个首选的激活合作伙伴,您可以配置 Clean Room 环境,使得当使用者在 Clean Room 中激活分析结果时,该合作伙伴是唯一的选择。
备注
您的自定义仅适用于新的 Clean Room。
要在 Clean Room 中控制可用的连接器,您需要 MANAGE_DCR_CONNECTORS 角色。
In the left navigation, select Admin » Profile & Features.
可选:要自定义激活连接器,请执行以下步骤:
在 Activation 磁贴中,选择 Edit。
选择您想要显示的激活选项,然后选择 Save。
可选:要自定义身份和数据提供程序连接器,请按照以下步骤操作:
在 Identity & Data Provider 磁贴中,选择 Edit。
选择您想要显示的身份选项,然后选择 Save。
给 Clean Room 标明品牌¶
您可以为 Clean Room 环境配置简介,以便创建的每个 Clean Room 都带有您的徽标和公司名称。要为您的公司定义徽标和名称,您需要 MANAGE_DCR_PROFILE_AND_FEATURES 角色。
In the left navigation, select Admin » Profile & Features.
在 Company profile 部分中,执行以下操作:
上传公司的徽标,格式为 JPG 或 PNG。这个标志将出现在创建的每个 Clean Room 上。
编辑 Company Name,定义您希望在环境中创建的 Clean Room 上显示的名称。
启用单点登录 (SSO)¶
To enable single sign-on (SSO) with Snowflake Authentication, contact Snowflake Support. An account must use Snowflake authentication to enable SSO; if you aren't using it yet, migrate to Snowflake authentication before requesting SSO.
允许密钥对身份验证¶
Clean Room 环境用于与 Snowflake 账户通信的服务账户用户使用 密钥对身份验证 进行身份验证。如果 Snowflake 账户使用 身份验证策略 来控制用户的身份验证方式,则控制服务账户用户的身份验证策略必须允许密钥对身份验证。
要允许密钥对身份验证,请移除所有身份验证策略,或者通过 AUTHENTICATION_METHODS = ALL 或 AUTHENTICATION_METHODS = KEYPAIR 添加身份验证策略。如果 Snowflake 账户具有不允许密钥对身份验证的账户级身份验证策略,则需要创建具有相应参数的新身份验证策略,然后将该策略分配给在安装过程中创建的服务账户用户。
您可以通过运行以下命令来检查您的身份验证策略:
SHOW AUTHENTICATION POLICIES;
空结果表表示没有策略,这意味着允许密钥对身份验证。
Manage the service user¶
The clean rooms UI uses a service user account as an intermediary to perform most clean room actions. You can modify the key or switch the clean rooms service user after it has been created or added to your account using the clean rooms UI as described in this section.
重要
Change the clean rooms service user only using the clean rooms UI. If you modify the service user outside of the UI, clean rooms might no longer be able to access the service user.
Change the service user¶
If you want to change the service user name or use a new service user (essentially the same thing):
Open Snowflake Admin » Service User Management and select
(Edit).
Change the name of the service user to a user that you have created and is accessible in the current account.
Select Reauthenticate to open a confirmation dialog.
Read the information in the dialog, then select Confirm to start using that agent.
Change the service user key¶
If you want to change your service user RSA key, you should do so as described next. If you change the key outside of the clean room environment, you will no longer be able to use most UI functionality until you change the service user key back as described next.
Open Snowflake Admin » Service User Management and select
(Edit).
Select Reauthenticate near the manual setup section to open a confirmation dialog.
Read the information in the dialog, then select Confirm to generate a new RSA key.
You can see information about the service agent's public key by running the following SQL command, substituting in your service user's name where indicated:
DESCRIBE USER <service_user_name> ->>
SELECT *
FROM $1
WHERE "property" ILIKE 'RSA_PUBLIC_KEY%';
Clean rooms doesn't support key rotation using RSA_PUBLIC_KEY_2, so ignore the information about RSA_PUBLIC_KEY_2.
在 Clean Room UI 中启用或禁用激活¶
使用 Clean Room UI 时的激活由 Clean Room 管理员全局控制。Clean Room API 中的激活由提供商在 Clean Room 级别上控制。
本节介绍如何在使用 Clean Room UI 时启用或禁用激活。要了解如何在使用 API 时启用激活,请阅读 激活说明。
使用 Clean Room UI 时,您的 Clean Room 账户中默认启用提供商和使用者激活。第三方激活必须手动启用。
以下是为账户中的 UI 用户启用或禁用激活的方法:
以 DCR 管理员身份 登录到 Web 应用程序中的 Clean Room 环境 UI。
Select Admin » Profile & Features.
在 Activation 部分中,选择 Edit。
要管理 使用者激活,请执行以下操作:选中或清除 Collaborator Account 旁的复选框。
要管理 提供商激活,请执行以下操作:选中或清除您自己的账户名称旁的复选框。
要管理 第三方激活,请执行以下操作:选中或清除要启用或禁用的第三方激活目标旁的复选框。第三方激活可通过连接器启用,并且仅在 Clean Room UI 中可用。请参阅可用的第三方连接器列表。
配置网络策略¶
如果 Snowflake 账户使用 网络策略 来控制网络流量,您必须明确允许来自 Clean Room UI 与 Snowflake 账户通信时所用 IP 地址的流量。
在下表中找到您的云提供商账户区域,并配置您的账户网络策略以允许在该行中列出所有 IP 地址:
Snowflake 账户区域 |
允许 Clean Room UI 的这些 IP 地址 |
|---|---|
|
52.7.249.136
34.195.16.248
52.7.210.215
|
|
15.223.145.218
3.96.6.109
15.222.142.44
|
|
54.93.86.99
3.126.238.8
3.127.143.168
|
|
35.154.94.29
13.235.168.249
15.206.48.175
|
|
13.228.90.174
52.220.42.130
52.220.249.16
|
|
52.65.205.236
52.62.198.227
3.104.160.96
|
查看此环境的服务账户的详细信息¶
Clean Room UI 使用服务账户与 Snowflake 进行通信。此服务账户是由账户管理员在为此账户安装 Clean Room 环境时创建的。
您不能修改有关服务账户用户的详细信息。
要查看有关此 Clean Room 环境的服务账户的详细信息,您需要 MANAGE_DCR_PROFILE_AND_FEATURES 角色。
导航到 Admin > Snowflake Admin。
在 Snowflake Admin 页面中您可以看到服务用户名和服务用户电子邮件等信息。