Set up secure data sharing and data marketplace listings
✓Works with OpenClaudeYou are a Snowflake data platform engineer. The user wants to set up secure data sharing between Snowflake accounts and create marketplace listings.
What to check first
- Run
SELECT CURRENT_ACCOUNT(), CURRENT_REGION();to confirm your account and region details - Verify you have ACCOUNTADMIN or SYSADMIN role:
SELECT CURRENT_ROLE(); - Check existing shares:
SHOW SHARES;andSHOW MANAGED ACCOUNTS;
Steps
- Create a share object using
CREATE SHARE share_name;— this is the container for shared data - Grant usage on the share to specify which account can access it:
ALTER SHARE share_name ADD ACCOUNTS = xyz12345;(use 12-character account identifier) - Create or identify the database containing data to share, then grant database privileges:
GRANT USAGE ON DATABASE shared_db TO SHARE share_name; - Grant schema-level access:
GRANT USAGE ON SCHEMA shared_db.public TO SHARE share_name; - Grant SELECT on specific tables:
GRANT SELECT ON TABLE shared_db.public.customer_data TO SHARE share_name; - For marketplace listings, set share comments and enable:
ALTER SHARE share_name SET COMMENT = 'Customer analytics dataset'; - Consumer account accepts share by running
CREATE DATABASE db_from_share USING SHARE producer_account.share_name; - Validate consumer access with
SELECT COUNT(*) FROM db_from_share.public.customer_data;
Code
-- Producer account: Create and configure share
CREATE SHARE analytics_share COMMENT = 'Customer behavioral analytics dataset';
-- Add consumer account (replace with actual account ID)
ALTER SHARE analytics_share ADD ACCOUNTS = xy12345678901;
-- Grant database and schema access
GRANT USAGE ON DATABASE analytics_db TO SHARE analytics_share;
GRANT USAGE ON SCHEMA analytics_db.shared_schema TO SHARE analytics_share;
-- Grant table-level permissions
GRANT SELECT ON TABLE analytics_db.shared_schema.customers TO SHARE analytics_share;
GRANT SELECT ON TABLE analytics_db.shared_schema.transactions TO SHARE analytics_share;
-- Grant select on view for computed metrics (recommended over raw tables)
GRANT SELECT ON VIEW analytics_db.shared_schema.customer_metrics TO SHARE analytics_share;
-- Verify share configuration
SHOW SHARES;
DESC SHARE analytics_share;
-- Consumer account: Accept incoming share
CREATE DATABASE shared_analytics
USING SHARE producer_account_id.analytics_share;
-- Validate access
SELECT * FROM shared_analytics.shared_schema.customers LIMIT 10;
-- Query shared data without copying (zero-copy)
SELECT
customer_id,
COUNT(*) as transaction_count,
SUM(amount) as total_spent
FROM shared_analytics.shared_schema.transactions
GROUP BY customer_id;
--
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Snowflake Skills
Other Claude Code skills in the same category — free to download.
Snowflake SQL
Write optimized Snowflake SQL with CTEs, window functions, and semi-structured data
Snowflake dbt Models
Build dbt models, tests, and macros for Snowflake transformations
Snowflake Streams & Tasks
Set up change data capture with streams and scheduled tasks
Snowflake Snowpipe
Configure continuous data ingestion with Snowpipe and external stages
Snowflake RBAC
Configure role-based access control with roles, privileges, and masking
Snowflake Stored Procedures
Write JavaScript and SQL stored procedures in Snowflake
Snowflake + Python
Use Snowpark for Python-based data engineering and ML in Snowflake
Want a Snowflake skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.