Snowflake Architecture · Topic 5 of 18
Data Sharing Methods, Share Configuration, Privileges and Security Patterns
Compare direct shares, listings and replication, configure shares and privileges, and apply secure view, database role and Business Critical rules.
- 5 min
- Live, read-only, no copy for shares and listings; replication makes a refreshed copy.
- Provider needs
CREATE SHARE; consumer database creation needsIMPORT SHAREplusCREATE DATABASE; consumer grantsIMPORTED PRIVILEGES. - Grant order:
USAGEon database,USAGEon schema,SELECTon objects.
What it is
Snowflake offers several ways to deliver data to another party, and an architect has to pick the one that matches the audience, the region and the security need. After that, the share has to be configured with the right objects, privileges and restrictions.
This page puts the methods side by side, then walks the configuration steps and the security patterns the exam keeps testing: secure views, database roles, REFERENCE_USAGE and the Business Critical restriction.
How it works
The sharing methods compared
| Method | Best for | Reach | Notes |
|---|---|---|---|
| Direct share | A few known accounts | Same region and cloud | Simplest; no discovery |
| Reader account | Consumers without Snowflake | Same region as provider | Provider pays compute |
| Private listing | Named accounts, optional paid terms | Any region and cloud | Uses Cross-Cloud Auto-Fulfillment |
| Marketplace listing | Public data products | Any region and cloud | Free, trial or paid access |
| Data Exchange | Private group of partners | Per exchange rules | Admin controls members |
| Data Clean Room | Joint analysis without raw access | Needs collaboration setup | Approved templates only |
| Database replication | Copy of a database in another account or region | Any | A real copy, refreshed manually or on a schedule |
All sharing methods except replication give live, read-only access with no copy. Replication produces a physical copy that costs storage in the target and must be refreshed.
Configuring a share
The provider needs ACCOUNTADMIN or a role with the global CREATE SHARE privilege. The order matters: containers first, then objects.
CREATE SHARE finance_share;
GRANT USAGE ON DATABASE fin_db TO SHARE finance_share;
GRANT USAGE ON SCHEMA fin_db.reporting TO SHARE finance_share;
GRANT SELECT ON VIEW fin_db.reporting.v_revenue_secure TO SHARE finance_share;
ALTER SHARE finance_share ADD ACCOUNTS = myorg.consumer_acct;
Things to remember about the provider side:
- New or recreated objects are not shared automatically; grant them again.
- Streams cannot be shared. Consumers create their own streams on shared tables or secure views.
SHOW GRANTS TO SHARE finance_shareconfirms what a share contains.- Add accounts using organization-qualified names.
On the consumer side, an administrator runs CREATE DATABASE ... FROM SHARE, which needs the IMPORT SHARE and CREATE DATABASE privileges (or ACCOUNTADMIN). Then access is given with GRANT IMPORTED PRIVILEGES ON DATABASE ... TO ROLE .... A consumer creates one database from each share.
Account parameters and restrictions
SHARE_RESTRICTIONS is a parameter on ALTER SHARE ... ADD ACCOUNTS.
| Value | Effect |
|---|---|
TRUE (default) | A Business Critical provider cannot add Standard or Enterprise consumers, and a HIPAA provider cannot add non-HIPAA consumers |
FALSE | Those consumers can be added |
ALTER SHARE finance_share ADD ACCOUNTS = myorg.std_acct SHARE_RESTRICTIONS = FALSE;
You must set it each time you add such a consumer. The point is to make the provider consciously accept that sensitive data leaves a higher security tier.
SHARE_RESTRICTIONS = FALSE does not make the data safer. It only removes the guard. Business Critical sharing of sensitive data with lower editions is discouraged.
Security patterns
Secure views. Non-secure views can now be shared too, but a secure view is the pattern for protecting data. A secure view hides its definition from consumers and prevents some optimizer behavior that could leak data. Use one to hide columns, filter rows or join tables before sharing.
Per consumer filtering. Put a mapping table of accounts and keys in the provider account and filter with CURRENT_ACCOUNT() inside the secure view. Do not use CURRENT_USER or CURRENT_ROLE in shared secure objects, because the consumer's users and roles are not the provider's. The session parameter SIMULATED_DATA_SHARING_CONSUMER lets the provider test what a consumer would see.
Database roles. Grant a database role to the share to segment access: consumers then grant each shared database role to their own roles. This cannot span several databases.
Referencing other databases. A secure view that reads another database in the same provider account needs GRANT REFERENCE_USAGE ON DATABASE other_db TO SHARE finance_share. Direct object grants can include multiple databases of the same account; database roles cannot.
| Grant style | Multiple databases | Segment access by role |
|---|---|---|
| Direct object grants to the share | Yes (same account) | No |
| Database roles granted to the share | No | Yes |
Data protection policies. Masking and row access policies protect your own tables. Expose protected data to consumers through secure views and test the result from the consumer view.
Common mistakes
Granting SELECT before USAGE. Container privileges come first: database, then schema, then object.
Using CURRENT_ROLE in a shared view. It evaluates in the consumer context and gives wrong or empty results. Use CURRENT_ACCOUNT().
Combining database roles with objects from many databases. REFERENCE_USAGE cannot be granted to a database role, so that design fails.
Ignoring that new objects are not auto shared. A table added next month needs its own grant.
What to remember for the exam
- Live, read-only, no copy for shares and listings; replication makes a refreshed copy.
- Provider needs
CREATE SHARE; consumer database creation needsIMPORT SHAREplusCREATE DATABASE; consumer grantsIMPORTED PRIVILEGES. - Grant order:
USAGEon database,USAGEon schema,SELECTon objects. - Use secure views to protect shared logic and rows (non-secure views can be shared but are not protected);
CURRENT_ACCOUNT()with a mapping table for per consumer rows. SHARE_RESTRICTIONSdefaults toTRUE;FALSEis needed to add non-Business Critical consumers to a Business Critical share.- Database roles segment access but cannot span multiple databases;
REFERENCE_USAGElinks a view to another database.
Check yourself
Which privilege lets a consumer admin create a database from a share?
IMPORT SHARE, or the ACCOUNTADMIN role. Roles then need IMPORTED PRIVILEGES on that database.
A Business Critical provider cannot add a Standard consumer to a share. What setting changes that?
SHARE_RESTRICTIONS = FALSE on the ALTER SHARE ... ADD ACCOUNTS statement.
Why does a share with a secure view over two provider databases need REFERENCE_USAGE?
The view reads a database that is not otherwise in the share. Granting REFERENCE_USAGE on that database to the share allows it.
Topic 5 of 18 in Snowflake Architecture
Test yourself on Snowflake Architecture
The full Snowflake ARA-C01 question bank has 687 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.