Data Sharing and Snowflake Marketplace · Topic 6 of 10

Inbound Data Shares and Installing Snowflake Data Clean Rooms

Import and maintain inbound data shares, then configure Snowflake Data Clean Rooms by installing the clean room native app and its API as ACCOUNTADMIN.

  • 5 min
In a nutshell
  • Inbound: CREATE DATABASE ... FROM SHARE needs IMPORT SHARE; one database per share; read only; grant IMPORTED PRIVILEGES.
  • Shared data is live and uncopied; to keep history, copy it with CREATE TABLE AS SELECT.
  • Clean rooms use collaborations with owner, data provider and analysis runner roles.

What it is

An inbound share is a share that another account created for you. You turn it into a read only database in your account, give roles access to it, and keep it working over time.

A Snowflake Data Clean Room is a different way to collaborate. Two or more parties analyze combined data under agreed rules, and no party sees the other's raw rows. Clean rooms are delivered as a Snowflake Native App, so the first job of the administrator is to install it.

Provider shareinboundCREATE DATABASE FROM SHAREShared databaseread onlyIMPORTED PRIVILEGESRolesquery with own warehouse

How it works

Import and maintain inbound shares

SHOW SHARES lists inbound shares and shows the provider and the database name if one exists. Importing needs the IMPORT SHARE privilege (or ACCOUNTADMIN) plus CREATE DATABASE.

SHOW SHARES;
CREATE DATABASE partner_sales FROM SHARE myorg.provider_acct.sales_share;
GRANT IMPORTED PRIVILEGES ON DATABASE partner_sales TO ROLE analyst;
FactDetail
Databases per shareOne database per share
AccessRead only; no insert, update, delete or changes to the shared objects
CostNo storage cost for shared data; queries use your own warehouse
FreshnessLive; changes by the provider are visible at once
Time Travel and cloneNot available on shared data
Re-shareA database from a share cannot be shared again by direct share
RolesGrant IMPORTED PRIVILEGES, or grant the shared database roles the provider offers

Maintenance tasks:

  • Keep a copy when you need history or your own transformations. Create a table from a query (CREATE TABLE ... AS SELECT) in your own database. The copy then costs storage and is no longer live.
  • Remove access to provider data by revoking IMPORTED PRIVILEGES or by dropping the database.
  • If the provider drops or revokes the share, queries fail. Check SHOW SHARES and ask the provider.
  • Provider objects change. Secure views and functions may change behind the share. Test the jobs that depend on them.
  • Shared database roles. When the provider shares database roles, grant each one to your own roles. This segments access.
Exam tip

IMPORTED PRIVILEGES is the single grant that opens a whole shared database to a role. A role without it cannot query the database or the objects in it.

Configure and manage Snowflake Data Clean Rooms

A clean room is built around a collaboration. A collaboration is defined by a specification that lists who takes part and in which role.

Role in a collaborationWhat it does
OwnerCreates the collaboration, assigns roles, can remove it; one owner
Data providerSupplies the data offerings, such as tables and views
Analysis runnerRuns approved templates on approved data offerings

One participant can hold more than one role. Every collaborator except the owner reviews the collaboration before joining. Data is analyzed only with approved templates, and results are returned under the agreed policies.

Ownercreates collaborationinvitesData provideroffers dataapproves templateAnalysis runnerruns analysisreturnsResultsunder policy

Availability and edition facts as the docs state them:

  • Generally available in specific regions on AWS, Azure and Google Cloud; not available in government regions or Virtual Private Snowflake.
  • Standard Edition or higher can create a collaboration or join as an analysis runner. Enterprise Edition or higher is needed to join as a data provider or to activate results.
  • Reader accounts are not supported.
  • Collaborators in other cloud regions need Cross-Cloud Auto-Fulfillment enabled.

Install the clean room native app

The installer works in the account that will take part and uses ACCOUNTADMIN.

Prerequisites:

  • The account has accepted the data sharing terms (contact Snowflake Support if it has not).
  • DEFAULT_DDL_COLLATION is not set, and QUOTED_IDENTIFIERS_IGNORE_CASE is FALSE.
  • The installing user has a first name, last name and verified email on the user object.

Steps:

  1. As ACCOUNTADMIN, install Snowflake Data Clean Rooms from the Snowflake Marketplace, open it and accept the defaults. This takes several minutes.
  2. In Snowsight, open the installed app and use Open in Worksheet to run the commands that install the clean rooms API. This also takes several minutes.
  3. Check the install: use SAMOOHA_APP_ROLE and call CHECK_MOUNT_STATUS() in the SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.LIBRARY schema. FALSE means the mount did not finish, so confirm the role and retry as ACCOUNTADMIN.
MarketplaceSnowflake Data Clean Roomsinstall as ACCOUNTADMINNative appinstalledrun API scriptClean rooms APISAMOOHA_APP_ROLECHECK_MOUNT_STATUSReadyusers granted access

The environment is installed for the whole account, but nobody can use it until an administrator grants access (next page).

Watch out

If you use the optional DRY_RUN review of the API script, do not run the installation script it prints by hand; that can leave the install incomplete.

Common mistakes

Querying a shared database without IMPORTED PRIVILEGES. The role gets an error or sees nothing.

Expecting a second database from the same share. Only one is allowed.

Trying to clone or time travel shared data. Not supported; copy it first.

Installing as a role other than ACCOUNTADMIN. The install needs it.

Starting a clean room on a reader account. It is not supported.

What to remember for the exam

  • Inbound: CREATE DATABASE ... FROM SHARE needs IMPORT SHARE; one database per share; read only; grant IMPORTED PRIVILEGES.
  • Shared data is live and uncopied; to keep history, copy it with CREATE TABLE AS SELECT.
  • Clean rooms use collaborations with owner, data provider and analysis runner roles.
  • Install from the Marketplace as ACCOUNTADMIN, run the API script, verify with CHECK_MOUNT_STATUS().
  • Data providers in a clean room need Enterprise Edition or higher.

Check yourself

  • Which privilege is needed to create a database from a share?

    IMPORT SHARE together with CREATE DATABASE, or the ACCOUNTADMIN role.

  • Who must install the clean room app?

    A user with ACCOUNTADMIN, with a verified email on the user.

  • Which clean room role needs Enterprise Edition or higher?

    The data provider.

Topic 6 of 10 in Data Sharing and Snowflake Marketplace

Test yourself on Data Sharing and Snowflake Marketplace

The full Snowflake ADA-C02 question bank has 814 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.