CertSafari
    Snowflake SnowPro Advanced: Data Engineer (DEA-C02)· Lessons

    Domain 1 · Lesson 6/22

    Snowflake data sharing: shares, secure views, listings and Streamlit apps

    Design and build data sharing and data consumption solutions.

    23 min read
    4% of exam
    13 sources
    Published 20 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Choose between a share and a zero-copy clone for a given consumer need
    • Create a share with CREATE SHARE, GRANT … TO SHARE and ALTER SHARE, and consume it as a read-only database
    • Explain why only secure views and secure UDFs can go into a share, and what secure views cost
    • Filter shared rows per consumer account with a secure view and test it with SIMULATED_DATA_SHARING_CONSUMER
    • Decide when a listing beats a direct share, publish one privately or on the Snowflake Marketplace, and configure auto-fulfillment for remote regions
    • Use Streamlit in Snowflake and its owner's-rights model to build dashboards and self-service data apps
    • Put a Streamlit dashboard over shared data for people who do not write SQL, and send them the view-only app URL

    Key concept

    Share — A named Snowflake object that holds the grants a provider makes on its own database objects, plus the list of consumer accounts allowed to use them. Consumers query the provider's live data through a read-only database built from the share. Nothing is copied.

    1.What a share gives a consumer: live, read-only data with nothing copied

    Secure Data Sharing gives another Snowflake account access to selected objects in your database without moving any bytes. The account that shares is the provider, and the account that receives is the consumer. The consumer builds a read-only database from the share and queries the provider's data where it already sits. Sharing runs through Snowflake's services layer and metadata store, so setting it up takes minutes, not a load job.

    Because the consumer reads the provider's data in place, a share is always current. When the provider commits a change, existing consumers see the new and modified rows at once. No task re-clones tables, no pipe re-ingests files, and neither side runs a refresh step. Objects the provider adds to the share also become available right away.

    The other side of live access is that every shared object is read-only. Consumers cannot insert, update or delete rows in shared tables, and they cannot drop shared objects. The costs split cleanly. Shared data uses no storage in the consumer account, so the consumer pays only for the warehouses that query it. The provider keeps paying for storage, as it did before sharing.

    Sharing only works between Snowflake accounts. To serve a consumer who has no Snowflake account, a provider creates a reader account. The provider owns and pays for that account, and it can consume data only from that provider. Reader account users can query what is shared with them, but they cannot load data or run INSERT, UPDATE or other DML. A reader account is a way to read someone else's data, never a place to change it.

    A read-only database helps only the people who can write SQL against it. Streamlit in Snowflake closes that gap: it runs Python data apps inside Snowflake, so a consumer can put a dashboard or a filter form over an imported database without exporting the data to an outside system. The imported database queries like any other, and the app's query results are cached automatically, so repeat views of the same filter do not rerun the query until the cache expires.

    A typical self-service dashboard connects with st.connection("snowflake"), pulls rows with conn.query(), and gives the user widgets such as st.multiselect to narrow the data before st.dataframe or a chart displays it. Access is then a grants question. A role needs USAGE on the app to open it, and the app-viewer URL, which hides the Snowsight interface, is the link to send to business users who only need to look and filter.

    Checkpoint 1 of 11· Check yourself

    A partner company has no Snowflake account. They need to query a dataset you share, and they also want to load their own CSV files next to it to join against. You create a reader account for them. What happens?

    Checkpoint 2 of 11· Exam question

    A provider wants a consumer to always see the latest committed rows in a shared table the moment the provider's transaction commits, with no manual refresh step on either side. Which characteristic of Secure Data Sharing delivers this?

    Sources12345

    2.Choosing between a share and a zero-copy clone

    The question to ask is who needs the data and whether they need to change it. A zero-copy clone is an independent, writable copy inside the same account. A share is a live, read-only view for another account. Each answers a different need, and picking the wrong one fails in a predictable way.

    Share versus zero-copy clone
    NeedShareZero-copy clone
    Who uses itAnother Snowflake account (or a reader account)Users in the same account
    Can users modify the data?No: all shared objects are read-onlyYes: it is an independent, writable copy
    Does it track the source?Yes: new and modified rows appear immediatelyNo: it is a point-in-time copy that diverges from the source
    Typical fitPartner feeds, cross-account distributionDestructive what-if work, dev and test snapshots

    Take a finance team that wants a nightly snapshot of SALES so it can run destructive transformations without touching production. A share is the wrong tool for two reasons: the consumer cannot modify shared objects, and the data keeps changing under the team because it is live. A reader account does not fix this, because reader accounts cannot run DML at all. The team needs a clone, which can be changed freely without touching production. Go the other way when a partner account needs current figures and must not change them. In that case the read-only, live share is exactly the right fit.

    Checkpoint 3 of 11· Check yourself

    Your QA team works in the same account as production. They need a frozen copy of the ORDERS table so they can test a migration script that deletes and rewrites rows. Which option fits?

    Checkpoint 4 of 11· Exam question

    A retailer's finance team needs a nightly, fully independent snapshot of the SALES database so they can run destructive what-if transformations without affecting the source or any other consumer, and without needing live updates from production. Which mechanism should the data engineer choose over Secure Data Sharing?

    Sources1

    3.Creating a share and consuming it

    Creating a share takes three steps: create an empty share, grant privileges on the objects it should expose, and add consumer accounts. You can prepare the objects with any role. Creating the share and adding accounts needs ACCOUNTADMIN or a role with the global CREATE SHARE privilege.

    Step 1: create an empty sharesql
    CREATE SHARE sales_s;

    Grants run from the outside in. Grant USAGE on the database first, then USAGE on the schema, then SELECT on the table or secure view. You can grant privileges directly to the share, or grant them to a database role and grant that role to the share. A database role lets you hand consumers one bundle that they assign to their own roles. A shared database role does not support future grants on objects.

    Step 2: grant container usage, then object access, directly to the sharesql
    GRANT USAGE ON DATABASE sales_db TO SHARE sales_s; GRANT USAGE ON SCHEMA sales_db.aggregates_eula TO SHARE sales_s; GRANT SELECT ON TABLE sales_db.aggregates_eula.aggregate_1 TO SHARE sales_s;
    Step 3: add consumer accountssql
    ALTER SHARE sales_s ADD ACCOUNTS=xy12345, yz23456;

    Three failures catch people here:

    • Adding an account before granting USAGE on the database returns an error.
    • Adding an account that does not exist reports success but leaves the share unchanged, so check account names with SHOW SHARES, whose to column lists every consumer.
    • An object you drop and recreate counts as a new object, even under the same name, so consumers lose it until you run GRANT … TO SHARE again.

    SHOW GRANTS TO SHARE lists what the share exposes, and DESCRIBE SHARE lists its objects.

    The consumer creates a database from the share and grants access to it to its own roles. A consumer can import any number of shares but can create only one database per share. Removing an account from a share cuts off its access immediately.

    Consumer side: let a local role use the database created from a sharesql
    GRANT IMPORTED PRIVILEGES ON DATABASE db_share TO ROLE db_share_role;

    Checkpoint 5 of 11· Fill the gap

    A provider wants consumers of sales_s to query the aggregate_1 table. Which privilege completes the last grant?

    GRANT USAGE ON DATABASE sales_db TO SHARE sales_s; GRANT USAGE ON SCHEMA sales_db.aggregates_eula TO SHARE sales_s; GRANT  ?  ON TABLE sales_db.aggregates_eula.aggregate_1 TO SHARE sales_s;

    Sources21

    4.Secure views: the only views a share accepts

    A standard view has two weaknesses that rule it out for sharing. First, its definition is visible: other users can read the query text and learn which tables and logic sit behind it. Second, some optimizer techniques for standard views touch base-table data, and user code such as a UDF could use them to expose rows the view was meant to hide. A secure view closes both gaps. Only the role that owns the view can see its definition, and the optimizer skips those leak-prone techniques.

    A share therefore accepts only secure objects for any logic that sits over your tables: secure views, secure materialized views and secure UDFs. Grant a standard view and Snowflake returns an error. Nothing happens silently, and nothing is converted for you. You make a view secure with CREATE or ALTER, the same way you define any view.

    A secure view in a share can reference tables by fully qualified name, but the database in that name must match the share's database. Sharing from several databases is a separate, documented case: a single share can draw on multiple databases as long as they all belong to the same account. A secure view that references objects in other databases has to be created through SQL, because Snowsight cannot add it to a share. Auto-fulfillment does not support such views either, so they cannot travel with a listing to another region. Snowsight also cannot add external tables, secure materialized views or secure UDFs to a share.

    Checkpoint 6 of 11· Check yourself

    In Snowsight, a provider tries to add a secure view in SALES_DB to a share. The view joins a table in CUSTOMER_DB, and Snowsight will not add it. What should the provider do?

    Checkpoint 7 of 11· Exam question

    A data engineer runs CREATE SHARE partner_share; and then attempts GRANT SELECT ON VIEW analytics.public.regional_summary TO SHARE partner_share;, where regional_summary is a standard (non-secure) view. What happens?

    Sources6217

    5.Filtering shared rows per consumer account

    A single share can serve many consumers, each seeing only its own rows. The usual pattern is an entitlement table that maps an access key to a Snowflake account. A secure view joins the data to that table and keeps only the rows whose account matches CURRENT_ACCOUNT(). Because the view runs in the consumer's session, CURRENT_ACCOUNT() returns the consumer's account, so each account gets a different slice of the same view. The same account-based filter can also be built as a row access policy instead of being written into the view.

    Test the filter before any consumer sees it. As the provider, set the SIMULATED_DATA_SHARING_CONSUMER session parameter to a consumer's account, then query the secure view to see exactly the rows that account will get. The parameter works with secure views and secure materialized views, but not with secure UDFs.

    Simulate querying shared secure views as consumer account xy12345sql
    ALTER SESSION SET SIMULATED_DATA_SHARING_CONSUMER = xy12345;

    Checkpoint 8 of 11· Fill the gap

    Before adding consumers, you want to confirm that your CURRENT_ACCOUNT()-filtered secure view returns only account xy12345's rows when xy12345 queries it. Which session parameter lets you run that test from the provider account?

    ALTER SESSION SET  ?  = xy12345;

    Sources28

    6.Listings and the Snowflake Marketplace

    A listing wraps a share in a data product: the share plus metadata such as a title, description, legal terms, a data dictionary and sample queries. A direct share, by contrast, sends bare database objects to accounts in your own region. A listing is the better choice when you need to reach other regions, publish on the Snowflake Marketplace, charge for access, or see consumer usage metrics. An existing direct share can be converted into a listing.

    Ways to offer a dataset
    OptionWho can get itNotes
    Direct shareNamed accounts in your regionNo metadata, no usage metrics
    Private listing (free or paid)Specified consumers, by organization and account nameCan reach other regions through auto-fulfillment
    Public free listingAnyone on the Snowflake MarketplaceFull product immediately, no charge
    Public paid listingAnyone on the Snowflake MarketplaceCharges for access; needs a Stripe Express account

    Listings are built in Provider Studio. Choose Create Listing, then either Specified Consumers for a private listing or Snowflake Marketplace for a public one. Then attach a data product. If you pick database objects, Snowflake creates a secure share for them. If you pick an existing share, that share backs the listing. Paid listings and Marketplace listings both require a provider profile.

    The privileges trip up teams that split the work between roles. Creating a data listing needs the global CREATE LISTING privilege, CREATE SHARE, and ownership of (or sufficient grants on) the shared objects. Publishing requires that the publishing role owns the attached share. Ownership of a share cannot be transferred, so if one role made the share and another made the listing, grant MODIFY on the listing to the role that owns the share.

    Converting a direct share to a listing changes the consumer's side too. Once the listing is available to them, each consumer drops the database it imported from the direct share. It then gets the listing and creates a database under the same name, so its queries keep working.

    Checkpoint 9 of 11· Match them up

    Match each way of offering a dataset to the situation it fits.

    Tap a term, then the definition that fits it.

    Sources19

    7.Auto-fulfillment: delivering a listing to other regions

    A direct share stops at your region's boundary. When a private listing names a consumer in another region, or a Marketplace consumer requests the listing from one, Snowflake turns on auto-fulfillment and copies the data product there after the consumer gets the listing. Under the hood this is cross-region and cross-cloud replication, so its limits apply: replicating a primary database is blocked when the database contains certain object types, and Snowflake keeps the full list in its replication limitations. Consumers in US government regions can receive a listing only through Cross-Cloud Auto-Fulfillment.

    A provider finds out about incompatible objects before publishing, not after. When you add a data product to a listing with automatic fulfillment, Snowflake runs a compatibility check, and if it reports incompatibilities you update the data product. One case is documented by name: a secure view that references data in another database is not supported. Refresh failures after launch are emailed daily to the address on the listing, and the LISTING_REFRESH_HISTORY function returns the past 14 days of refresh history for each target region.

    The provider sets two things in the listing's Auto-fulfillment section. The first is a refresh interval, a value and a unit that control how often the data product is copied from your region to the remote one. The second is a warehouse to run that work, if you have no default warehouse set.

    What drives auto-fulfillment cost
    Cost typeDriven by
    ComputeQueries Snowflake runs to fulfill the listing; refresh frequency sets how often they run
    StorageDatabase size and how fast data is appended, updated and changed
    Data transferTarget region and its cloud provider; each extra region adds cost

    These costs belong to the provider. They are charged to one Snowflake-managed secure share area per region that has active consumers of your listings. A shorter interval means fresher remote data but more compute, and each additional consumer region adds its own transfer and storage costs. Set the interval from how fresh remote consumers actually need the data, not from how often the source changes.

    Checkpoint 10 of 11· Check yourself

    An analytics customer runs its Snowflake account on Azure West Europe. Your provider account is on AWS us-east-1. The customer needs your SALES data refreshed every few hours. What should you set up?

    Sources921071112

    8.Streamlit in Snowflake for dashboards and self-service access

    Some consumers need a screen they can click through, not SQL access. Streamlit is an open-source Python library for building data web apps. Streamlit in Snowflake runs those apps inside Snowflake, so neither the data nor the code moves to an external system. Snowflake manages the compute and storage. The app is stored as a schema-level object, and role-based access control decides who can open it. Typical apps are interactive dashboards for exploring data and self-service tools that let business users filter and pull data on their own.

    What a viewer can see is decided by the app's owner, not by the viewer's own privileges. By default an app runs with the owner's privileges, not the caller's. It uses the owner's warehouse and the database and schema the app was created in. The owner chooses which roles may use the app. Those viewers can interact with it and see anything it displays, even data their own roles could never query.

    Checkpoint 11 of 11· Check yourself

    To give each partner its own slice, a developer suggests filtering on CURRENT_ROLE() in a secure view. Partner accounts will query this view through a share, and it also feeds an internal Streamlit dashboard. What happens when a consumer account queries the shared view?

    Sources313

    Practise it for real

    Share one table from a provider account with a consumer account and confirm what the share exposes.

    1. 1.As ACCOUNTADMIN (or a role with CREATE SHARE), run CREATE SHARE sales_s;

      Why: A share starts empty. It is the container that grants and accounts attach to.

      You should see: The share exists and SHOW SHARES lists it with kind OUTBOUND.

    2. 2.Grant USAGE on the database, USAGE on the schema, then SELECT on the table to the share.

      Why: Grants must go from container to contents, and the database grant must exist before any account is added.

      You should see: SHOW GRANTS TO SHARE sales_s lists three rows: database, schema and table.

    3. 3.Run ALTER SHARE sales_s ADD ACCOUNTS=xy12345; with your consumer account's name in place of xy12345, then run SHOW SHARES.

      Why: Adding an account that does not exist reports success silently, so check the result.

      You should see: The to column of SHOW SHARES lists the consumer account.

    4. 4.In the consumer account, create a database from the share and grant IMPORTED PRIVILEGES on it to a role.

      Why: The consumer's own RBAC decides which local roles can query the shared data.

      You should see: That role can SELECT from the table but cannot INSERT, UPDATE or DELETE.

    Stuck? Get a nudge

    If ALTER SHARE fails with an error, check whether USAGE on the database was granted to the share first.

    Sources

    (13)

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

    1. 1.
      “With Secure Data Sharing, no actual data is copied or transferred between accounts.”
      ↩︎ What a share gives a consumer: live, read-only data with nothing copied
      “The only charges to consumers are for the compute resources (i.e. virtual warehouses) used to query the imported data.”
      ↩︎ What a share gives a consumer: live, read-only data with nothing copied
      “Providers continue to pay for storage of the data that they share.”
      ↩︎ What a share gives a consumer: live, read-only data with nothing copied
      “cannot perform any of the DML tasks that are allowed in a full account, such as data loading, insert, update”
      ↩︎ What a share gives a consumer: live, read-only data with nothing copied
      “a reader account can only consume data from the provider account that created it”
      ↩︎ What a share gives a consumer: live, read-only data with nothing copied
      “All database objects shared between accounts are read-only”
      ↩︎ Choosing between a share and a zero-copy clone
      “consumers query the provider’s data in place through a read-only database that they create from the share.”
      ↩︎ Choosing between a share and a zero-copy clone
      “you can only create one database per share”
      ↩︎ Creating a share and consuming it
      “The provider can also share data from multiple databases, as long as these databases belong to the same account.”
      ↩︎ Secure views: the only views a share accepts
      “Use a listing when you want to share across regions, offer data publicly on the Snowflake Marketplace, charge for access”
      ↩︎ Listings and the Snowflake Marketplace
      “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.”
      ↩︎ Exam trap 3
      “Users in a reader account can query data that has been imported with the reader account, but cannot perform any of the DML tasks”
      ↩︎ Checkpoint
      “All database objects shared between accounts are read-only (i.e. the objects cannot be modified or deleted, including adding or modifying table data).”
      ↩︎ Checkpoint
      “A direct share works only with accounts in the same region. To share across regions or cloud platforms, use a listing with cross-cloud auto-fulfillment”
      ↩︎ Checkpoint
      “A direct share works only with accounts in the same region. To share across regions or cloud platforms, use a listing with cross-cloud auto-fulfillment”
      ↩︎ Checkpoint
    2. 2.
      “New and modified rows are available immediately to consumers who have created a database from the share.”
      ↩︎ What a share gives a consumer: live, read-only data with nothing copied
      “require the ACCOUNTADMIN role or a role granted the global CREATE SHARE privilege”
      ↩︎ Creating a share and consuming it
      “first grant usage on any container objects before granting usage on the objects in the container”
      ↩︎ Creating a share and consuming it
      “A shared database role does not support future grants on objects.”
      ↩︎ Creating a share and consuming it
      “Attempting to add an account before granting usage on a database results in an error.”
      ↩︎ Creating a share and consuming it
      “if the accounts do not exist, the command completes successfully, but no updates are made to the share.”
      ↩︎ Creating a share and consuming it
      “you must use secure views, secure materialized views and/or secure UDFs”
      ↩︎ Secure views: the only views a share accepts
      “you must ensure that the referenced database name matches the database for the share.”
      ↩︎ Secure views: the only views a share accepts
      “you can decide to use a single share to partition shared data for different consumer accounts”
      ↩︎ Filtering shared rows per consumer account
      “The SIMULATED_DATA_SHARING_CONSUMER session parameter only supports secure views and secure materialized views, but does not support secure UDFs.”
      ↩︎ Filtering shared rows per consumer account
      “replicating a primary database is blocked if the database contains some types of objects.”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
      “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
      “if you drop and then recreate an object, it is still considered a new object, even if the name is the same.”
      ↩︎ Exam trap 2
      “Do not include secure objects that use the CURRENT_USER or CURRENT_ROLE functions in their definition.”
      ↩︎ Exam trap 4
      “only secure views are supported in shares at this time. If a standard view is added to a share, Snowflake returns an error.”
      ↩︎ Prediction
      “need to add a secure view that references objects in other databases, you must create your share using SQL”
      ↩︎ 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.
      “you can build applications that process and use data in Snowflake without moving data or application code to an external system”
      ↩︎ What a share gives a consumer: live, read-only data with nothing copied
      “you can build applications that process and use data in Snowflake without moving data or application code to an external system”
      ↩︎ Streamlit in Snowflake for dashboards and self-service access
      “within a Snowflake object that uses Role-based Access Control (RBAC) to manage access to your Streamlit app”
      ↩︎ Streamlit in Snowflake for dashboards and self-service access
      “For additional use cases on building dashboards, data tools, and ML/AI, see Streamlit in Snowflake demos.”
      ↩︎ Streamlit in Snowflake for dashboards and self-service access
    4. 6.
      “For a non-secure view, internal optimizations can indirectly expose data.”
      ↩︎ Secure views: the only views a share accepts
      “With secure views, the view definition and details are visible only to authorized users”
      ↩︎ Secure views: the only views a share accepts
      “Secure views should not be used for views that are defined solely for query convenience”
      ↩︎ Secure views: the only views a share accepts
      “Secure views can execute more slowly”
      ↩︎ Secure views: the only views a share accepts
    5. 7.
      “Cross-Cloud Auto-Fulfillment does not support secure views that reference data stored in other databases.”
      ↩︎ Secure views: the only views a share accepts
      “Cross-Cloud Auto-Fulfillment does not support secure views that reference data stored in other databases.”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
    6. 8.
      “CURRENT_ACCOUNT() gives your account access to the AAPL and MSFT data.”
      ↩︎ Filtering shared rows per consumer account
    7. 9.
      “A listing combines a product with a way for consumers to get it.”
      ↩︎ Listings and the Snowflake Marketplace
      “Create a provider profile to offer paid listings or listings on the Snowflake Marketplace.”
      ↩︎ Listings and the Snowflake Marketplace
      “You can’t transfer OWNERSHIP of a share.”
      ↩︎ Listings and the Snowflake Marketplace
      “Drop the existing imported database created from the direct share.”
      ↩︎ Listings and the Snowflake Marketplace
      “Snowflake enables auto-fulfillment to replicate data to the remote region after a consumer gets your listing.”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
      “enter a value and select an interval to specify how often to replicate your data product from your region to the remote region”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
    8. 10.
      “Snowflake performs a compatibility check to validate that your data product can be auto-fulfilled to other regions.”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
    9. 11.
      “Snowflake sends a daily email that summarizes failed listing refreshes to the email address specified on the listing.”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
      “call the LISTING_REFRESH_HISTORY function, which returns the past 14 days of refresh history for each target region”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
    10. 12.
      “The refresh frequency that you set affects how frequently these queries run.”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
      “these usage costs are attributed to one Snowflake-managed secure share area for each region that contains active consumers of your listings”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
      “The more regions that consumers request your listing in, the higher the cost to fulfill those listings, due to the data transfer cost.”
      ↩︎ Auto-fulfillment: delivering a listing to other regions
    11. 13.
      “Run with the privileges of the owner, not the privileges of the caller.”
      ↩︎ Streamlit in Snowflake for dashboards and self-service access
      “Viewers can interact with the app and see anything displayed on the screen.”
      ↩︎ Streamlit in Snowflake for dashboards and self-service access
      “Run with the warehouse provisioned by the app owner.”
      ↩︎ Streamlit in Snowflake for dashboards and self-service access

    Ready to test yourself?

    Practise the 11 questions on this subdomain.

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