CertSafari
    Snowflake SnowPro Advanced: Administrator (ADA-C02)· Lessons

    Domain 5 · Lesson 21/24

    Outbound shares, secure objects and cross-region sharing in Snowflake

    Implement and manage data sharing.

    17 min read
    3.5% of exam
    8 sources
    Published 20 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Choose between a direct share, a listing, a data exchange and a clean room for a given sharing model
    • Create a share, grant objects to it directly or through database roles, and maintain it as objects change
    • Expose data safely with secure views, secure materialized views and secure UDFs, including views that span databases
    • Filter one share per consumer account and avoid context functions that break in a consumer account
    • Share with accounts in other regions, clouds and editions through replication or cross-cloud auto-fulfillment

    Key concept

    Share — A named object in the provider account that holds grants on selected database objects and the list of consumer accounts allowed to use them. Nothing is copied: consumers query the provider's data in place, read-only.

    1.Sharing models: who gets the data, and how

    Secure Data Sharing lets one Snowflake account, the provider, expose selected database objects to other accounts, the consumers, without copying anything. Sharing runs through Snowflake's services layer and metadata store, so a consumer's imported data takes no storage in their account; they pay only for the warehouses that query it, while the provider keeps paying for storage. Every shared object is read-only on the consumer side: no inserts, no updates, no drops.

    The sharing model is about how many consumers you serve and how visible the offer is. One-to-one is a share with a single consumer account added. One-to-many is the same share with many accounts added. Snowflake puts no cap on either number, but once the audience grows, a listing or a data exchange is easier to run than a long account list. Private sharing reaches named accounts: a direct share, a private listing, or a data exchange whose membership you control. Public sharing means a listing on the Snowflake Marketplace, which Snowflake Marketplace listings covers.

    The four ways to share, and when each one fits
    OptionWhat it isChoose it when
    Direct shareSpecific database objects shared to another account in your regionA few known consumers in the same region, no metadata or charging needed
    ListingA share plus metadata, offered as a data product to one or more accountsConsumers are in other regions, you want the Marketplace, charge for access, or need usage metrics
    Data ExchangeA group of accounts you set up and manage, offered a share as a groupA controlled private community of consumers
    Clean roomShared data where you control which queries can be runPartners must analyse data together without seeing each other's rows

    A direct share is limited to your region, and that limit decides a lot of scenario questions. Once a consumer sits in another region or cloud, the answer is either a listing with auto-fulfillment or replication, both covered below. You can also convert an existing direct share into a listing later, so starting direct does not lock you in.

    Checkpoint 1 of 9· Match them up

    Match each way of sharing to the scenario it fits best

    Tap a term, then the definition that fits it.

    Sources1

    2.Creating and maintaining an outbound share

    Building a share takes three steps: create it, grant privileges on the objects, then add consumer accounts. Preparing the objects can be done by any role. Creating the share and adding accounts needs ACCOUNTADMIN or a role holding the global CREATE SHARE privilege. The role that grants objects must also own the database, or hold USAGE on it WITH GRANT OPTION. A consumer cannot reach a view without the USAGE grants on its database and schema, so those come first.

    A share that exposes one secure view: USAGE on the database and schema, SELECT on the viewsql
    CREATE SHARE share1; GRANT USAGE ON DATABASE db1 TO SHARE share1; GRANT USAGE ON SCHEMA db1.sch TO SHARE share1; GRANT SELECT ON VIEW db1.sch.view1 TO SHARE share1;

    Objects reach a share in one of two ways: grant privileges directly to the share, or grant them to a database role and then grant that database role to the share. Database roles are roles that live inside a database, as covered in Database roles. In a share, their advantage is splitting one share into separately grantable subsets. One database role might carry the summary views and another the detailed ones, and each consumer account maps whichever it needs to its own roles. A shared database role does not support future grants, so new objects still have to be granted to it explicitly.

    Ongoing maintenance mostly comes down to knowing what propagates by itself. New and changed rows in already-shared objects reach consumers immediately. A newly created object does not, and neither does a dropped-and-recreated one, until you grant it to the share again. Adding an account makes the share available to it at once, and access to the share or to any object in it can be revoked at any time. Two commands audit a share: SHOW GRANTS TO SHARE lists the object privileges in it, and SHOW GRANTS OF SHARE lists the accounts and shows which ones are using it.

    Consumers who want change data capture build their own streams on what you share. For that to work, the provider enables CHANGE_TRACKING on the shared tables and raises DATA_RETENTION_TIME_IN_DAYS, because a stream on a shared table does not extend the table's retention. Sharing a secure view built on a stream of your own is an anti-pattern, since nobody can modify a stream in another account.

    Checkpoint 2 of 9· Check yourself

    Several consumer accounts want to run change data capture on two tables you share with them. What should you, as the provider, do so that their streams work reliably?

    Sources21

    3.Secure views, secure UDFs and views that span databases

    Shares expose logic through secure objects, and a standard view is rejected outright. If you grant a standard view to a share, Snowflake returns an error. The fix is to recreate it with CREATE SECURE VIEW, grant SELECT on the secure view, and keep the USAGE grants on its database and schema. As explained in Views, secure views and materialized views, a secure view hides its definition and internals from users who don't own it. That matters in a share because the consumer should see the rows, not your joins or business rules. The same applies to materialized views, which are shareable only as secure materialized views. Stored procedures are not on the list of shareable objects at all.

    Sharing entire tables needs no preparation. Filtering by a condition, or by consumer account, needs secure objects. Snowflake strongly recommends sharing secure views or secure UDFs rather than tables, so the base tables and the business logic stay hidden. UDFs can be shared as secure or non-secure, and a secure UDF hides its body the way a secure view hides its query. On multi-terabyte base tables, add clustering keys so the secure objects your consumers query perform well.

    Which object to share for which requirement
    RequirementObject to share
    Whole table, no filtering, internals not sensitiveTable
    Subset of rows or columns, definition hiddenSecure view
    Precomputed results, definition hiddenSecure materialized view
    Reusable logic or calculation, body hiddenSecure UDF
    Join across databases in the provider accountSecure view plus REFERENCE_USAGE on each other database

    A secure view that reads from a second database needs one extra grant. Say the view lives in ANALYTICS and joins a table in RAW_DB. Grant REFERENCE_USAGE on RAW_DB to the share, then grant SELECT on the view. You do not grant SELECT on RAW_DB's tables, so only the view is exposed, and no REFERENCE_USAGE is needed on ANALYTICS itself. Both databases must belong to the same account. This path cannot go through a database role: REFERENCE_USAGE cannot be granted to one, and a multi-database view cannot be granted to a share through one. IMPORTED PRIVILEGES does not belong here either. It is the grant a consumer runs on a database they imported, not a provider grant.

    Checkpoint 3 of 9· Check yourself

    A provider's share already has USAGE on database SALES and schema SALES.PUB. The provider then runs GRANT SELECT ON VIEW SALES.PUB.REGION_TOTALS TO SHARE s1, where REGION_TOTALS is a standard (non-secure) view. What happens, and what is the fix?

    Checkpoint 4 of 9· Exam question

    A provider administrator wants to add a standard view, which joins the orders and customers tables, to an outbound share. The consumer must not be able to read the view definition. What is the MOST appropriate approach?

    Checkpoint 5 of 9· Exam question

    A provider keeps curated tables in database ANALYTICS, and a secure view in ANALYTICS reads a table from a second database, RAW_DB. Granting SELECT on the view to a share fails. Which action resolves the failure while exposing only the view?

    Sources34

    4.Context functions: one share, different rows per consumer

    A single share can give each consumer account its own rows. The standard pattern uses two schemas. A private schema holds the base table and a mapping table that pairs an access key with the accounts allowed to see it. A public schema holds the secure view, and only the public schema is shared. The view joins the base table to the mapping table and keeps the rows whose mapped account matches the account running the query, which the view reads with CURRENT_ACCOUNT. The access key column does not need to appear in the view's output.

    Session-specific context functions are what break. The values of CURRENT_USER and CURRENT_ROLE belong to the consumer's account, where your users and roles don't exist, so a secure object built on them fails when a consumer queries it. Role checks such as IS_ROLE_IN_SESSION look at the active primary and secondary role hierarchy, which is also the consumer's own. Filter shared data by account, the one identity both sides agree on, rather than by who the user is or which role they hold.

    Test a per-account view before granting it. Set the SIMULATED_DATA_SHARING_CONSUMER session parameter to a consumer account name, query the view, and you see exactly what that account will see. The parameter works for secure views and secure materialized views but not secure UDFs, so a UDF's per-account logic has to be checked another way.

    Simulating consumer account xy12345 before sharing a filtered viewsql
    ALTER SESSION SET SIMULATED_DATA_SHARING_CONSUMER = xy12345;

    Checkpoint 6 of 9· Check yourself

    You want one share to give each consumer account only its own rows of a customer table. Which secure view design works once consumers query it?

    Checkpoint 7 of 9· Fill the gap

    Before you grant a per-account secure view to the share, you want to see exactly which rows consumer account xy12345 will get. Which session parameter completes the statement?

    ALTER SESSION SET  ?  = xy12345;

    Sources325

    5.Sharing across regions, clouds and editions

    Cross-region direct sharing works by first bringing the data into the consumer's region with replication. The provider needs an account of its own in the target region, linked in the same organization. An organization administrator enables replication for the source and target accounts. The provider then replicates the database, together with the share, to that account through a replication group as described in Replication groups and failover groups. Older setups enable replication on the individual database instead. Consumers are added to the share in the target account, and every account added there must be local to that account's region. Cloning cannot do this job, and a reader account is no workaround, because reader accounts are created in the provider's own region.

    Primary replication group in the source account, carrying a database and its share to account_2sql
    USE ROLE ACCOUNTADMIN;
    
    CREATE REPLICATION GROUP my_rg
      OBJECT_TYPES = databases, shares
      ALLOWED_DATABASES = db1
      ALLOWED_SHARES = share1
      ALLOWED_ACCOUNTS = acme.account_2;

    In the target account, CREATE REPLICATION GROUP my_rg AS REPLICA OF the primary, then ALTER REPLICATION GROUP my_rg REFRESH, then ALTER SHARE share1 ADD ACCOUNTS for the local consumers. A REPLICATION_SCHEDULE on the primary group automates the refresh. You keep one copy per region, not one per consumer. Replication works on whole databases, so if only some rows should travel, copy them into a smaller database with a stream and a task and replicate that. If a shared view reads several databases, every one of them goes into the replication group.

    Listings take the replication work off your hands. With Cross-Cloud Auto-Fulfillment, Snowflake fulfills the data product into a region only when a consumer there asks for it, and the provider pays only for that demand. The provider picks a refresh frequency of at most 8 days. One limit catches people out: auto-fulfillment does not support secure views that reference data in other databases, so a REFERENCE_USAGE design has to be flattened into one database first. The LISTING_AUTO_FULFILLMENT_REFRESH_DAILY view in DATA_SHARING_USAGE shows what each refresh transferred and the credits it used.

    Cross-cloud governance has three parts. First, replicating to another country or region can collide with legal or regulatory rules on where data may live, so check those before creating the secondary. Second, a Business Critical provider must ask Snowflake to enable sharing with non-Business Critical accounts. Before that, keep sensitive data out of such shares, or put the less sensitive data in a separate non-Business Critical account and share from there. Third, under Tri-Secret Secure, consumer queries count as access from inside your own account, which can involve your cloud key management service.

    Checkpoint 8 of 9· Put it in order

    Put these steps in order to make an AWS us-east-1 share available to consumer accounts in Azure West Europe

    1. 1.Create a provider account in Azure West Europe and link it to the source account in the same organization
    2. 2.In the target account, create a secondary replication group AS REPLICA OF the primary group
    3. 3.In the target account, add the local consumer accounts to the replicated share with ALTER SHARE ... ADD ACCOUNTS
    4. 4.Refresh the secondary replication group so the database and share are copied to the target account
    5. 5.Have an organization administrator enable replication for the source and target accounts
    6. 6.In the source account, create a primary replication group that includes the database and the share

    Checkpoint 9 of 9· Exam question

    A provider in AWS us-east-1 must share a database with a customer whose Snowflake account runs on Azure West Europe. Both parties want a direct share, not a listing. Select TWO actions that the provider should take.(Select 2)

    0 of 2 selected

    Sources6782

    Sources

    (8)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “a Direct Share, in which you directly share specific database objects (a share) to another account in your region,”
      ↩︎ Sharing models: who gets the data, and how
      “You can create as many shares as you want, and add as many accounts to a share as you want.”
      ↩︎ Sharing models: who gets the data, and how
      “Shared data does not take up any storage in a consumer account”
      ↩︎ Sharing models: who gets the data, and how
      “Use a listing when you want to share across regions, offer data publicly on the Snowflake Marketplace, charge for access”
      ↩︎ Sharing models: who gets the data, and how
      “Option 1: Grant privileges on objects to a share via a database role.”
      ↩︎ Creating and maintaining an outbound share
      “Shares are named Snowflake objects that encapsulate all of the information required to share a database.”
      ↩︎ Key concept
      “A direct share works only with accounts in the same region.”
      ↩︎ Prediction
    2. 2.
      “require the ACCOUNTADMIN role or a role granted the global CREATE SHARE privilege”
      ↩︎ Creating and maintaining an outbound share
      “A shared database role does not support future grants on objects.”
      ↩︎ Creating and maintaining an outbound share
      “The SIMULATED_DATA_SHARING_CONSUMER session parameter only supports secure views and secure materialized views, but does not support secure UDFs.”
      ↩︎ Context functions: one share, different rows per consumer
      “consider the following to maintain the expected level of data protection before requesting Snowflake to enable Secure Data Sharing with non-Business Critical accounts”
      ↩︎ Sharing across regions, clouds and editions
      “only secure views are supported in shares at this time. If a standard view is added to a share, Snowflake returns an error.”
      ↩︎ Exam trap 1
      “Do not include secure objects that use the CURRENT_USER or CURRENT_ROLE functions in their definition.”
      ↩︎ Exam trap 3
      “A new object created or recreated in a database granted to a share is not automatically available to consumers.”
      ↩︎ Prediction
      “you need to extend the data retention period for the tables, and you also need to enable change tracking on the shared tables”
      ↩︎ Checkpoint
      “only secure views are supported in shares at this time. If a standard view is added to a share, Snowflake returns an error.”
      ↩︎ Checkpoint
      “The contextual values returned by these functions have no relevance in a consumer’s account and will cause the object to fail when queried/used.”
      ↩︎ Checkpoint
    3. 3.
      “Snowflake strongly recommends sharing secure views and/or secure UDFs instead of directly sharing tables.”
      ↩︎ Secure views, secure UDFs and views that span databases
      “only required if you wish to share the data in the base table with multiple consumer accounts”
      ↩︎ Context functions: one share, different rows per consumer
    4. 4.
      “you must also grant the REFERENCE_USAGE privilege on each database referenced by a secure view that you wish to share.”
      ↩︎ Secure views, secure UDFs and views that span databases
      “However, you do not need to grant REFERENCE_USAGE on the database that contains the secure view.”
      ↩︎ Secure views, secure UDFs and views that span databases
      “You cannot use database roles to share data from multiple databases.”
      ↩︎ Exam trap 2
    5. 5.
      “Verifies whether the specified account role is in the currently active primary or secondary role hierarchy.”
      ↩︎ Context functions: one share, different rows per consumer
    6. 6.
      “Data providers only need to create one copy of the dataset per region; and not a copy per consumer.”
      ↩︎ Sharing across regions, clouds and editions
      “you should confirm that your organization does not have any legal or regulatory restrictions as to where your data can be transferred or hosted.”
      ↩︎ Sharing across regions, clouds and editions
      “Any account that you add to the share should be local to the region of the target account.”
      ↩︎ Exam trap 4
      “Before configuring data replication, you must create an account in a region where you wish to share data and link it to your local account.”
      ↩︎ Checkpoint
    7. 7.
      “you incur costs only when there is consumer demand in that region”
      ↩︎ Sharing across regions, clouds and editions
    8. 8.
      “Cross-Cloud Auto-Fulfillment does not support secure views that reference data stored in other databases.”
      ↩︎ Sharing across regions, clouds and editions

    Continue to part 2 of 2

    Inbound shares, reader accounts and Snowflake Data Clean Rooms

    Spotted a mistake, or was something unclear? Tell us.