Sharing data from multiple databases (2024)

Snowflake data providers can share data from multiple databases by using secure views. A secure view can reference objects suchas schemas, tables, and other views contained in one or more databases, as long as those databases belong to the same account.

Sharing a secure view that references objects from multiple databases is different from sharing data contained in asingle database.

In addition to performing all the standard steps to share data, you must also grant the REFERENCE_USAGE privilegeon each database referenced by a secure view that you wish to share. However, you do not need to grant REFERENCE_USAGE on thedatabase that contains the secure view.

Note

You cannot use database roles to share data from multiple databases. You cannot grant the REFERENCE_USAGE privilege to adatabase role and you cannot use a database role to grant a secure viewthat references objects from multiple databases to a share.

You must grant the REFERENCE_USAGE privilege separately on each database referenced in a secure view, before granting thesecure view to a share.

To share a secure view that references objects from multiple databases:

  1. Connect to your Snowflake account as a user with the ACCOUNTADMIN role or a role granted the CREATE SHARE global privilege.For more details about the CREATE SHARE privilege, see Enabling non-ACCOUNTADMIN roles to perform data sharing tasks.

  2. Create a share using CREATE SHARE.

  3. Grant the USAGE privilege on the database you wish to share using GRANT <privilege> … TO SHARE.

    Note

    If you are sharing a secure view that references objects contained in multiple databases, you only need to grant the USAGE privilegeto the database where the secure view is created. You can only grant USAGE to one database per share.

    Granting the USAGE privilege to the database associates the share with a database, which is required to grant other privilegesto the share.

  4. Grant the USAGE privilege on each schema in the database you wish to share using GRANT <privilege> … TO SHARE.

  5. Grant the REFERENCE_USAGE privilege on each additional database that contains objects referenced by the view you wish to share usingGRANT <privilege> … TO SHARE.

  6. Add the view to the share by granting the SELECT privilege on the view using GRANT <privilege> … TO SHARE.

  7. Add one or more consumer accounts to the share using ALTER SHARE.

The share is now ready to be consumed by the specified accounts.

Note

To share a secure view that references a UDF in a different database, you must make the UDF secure. For more details about creating asecure UDF, see Creating a Secure UDF or Stored Procedure.

Examples

Refer to the following examples for creating secure views.

Sharing data from multiple database with consumers in other regions

You can share data from multiple databases with consumer accounts in other regions and cloud platforms by using a replication group.Include the share and each database the share references in the group to replicate data to a Snowflake account in another region.You can then add consumer accounts to the replicated share. For detailed instructions,see Sharing data securely across regions and cloud platforms.

Sharing data from multiple databases (2024)
Top Articles
If stocks of a company have been held that issued dividends, how and when will the dividends be received?
What is Master Data Management | Definition, Tools, Solutions
Craigslist Dump Trucks For Sale By Owner
The 10 Hardest Video Games Of All Time
888-490-1703
Dontrell Williams Miami First 48
The Financial Benefits of Earning a College Degree
Milesplit Com Colorado
Amaya Hodges Missing
My Compeat Workforce
Specialkfree Cooler.com
Hingham Police Scanner Wicked Local
Craigslist Akron Canton Ohio
Login.northlane.com Balance
Rescare Training Online
Cranston Sewer Tax
Shoreone Insurance A.m. Best Rating
Bible Gateway passage: John 6 - New International Version
Oldeuboi Showtimes Near Marcus Ronnie's Cinema
Closest Airport To Parker Az
Math-Aids.com Answers
Theater + Tickets - Phoenix Theatres Savoy 16 + IMAX - Phoenix Theatres Entertainment
URB-E Electric Folding Scooter Review | Gear Gadgets and Gizmos
what plus what equals 16 but also minus to be 4
Best Car Wash Soap for 2022
2 white supremacists tried to spark race war by soliciting murder and hate crimes on Telegram, feds say
Jessica Oldwyn Carroll Update
Verizon Outage Cuyahoga Falls Ohio
Matthew 14 Nasb
Rhiel Funeral Durand
Watermarke Tower Shooting
Jessica Ann Ussery Wiki
Emily Alexander Leaked
Dayz Improvised Shelter
Devotion Showtimes Near O'neil Cinemas - Brickyard Square 12
Publix Super Markets | LinkedIn
Software and Applications Distribution | GW Information Technology | The George Washington University
Tricare Dermatologists Near Me
Iowa State Map Campus
Tristatehomepage Evansville
Craigslist Gigs Galveston
Kickflip Seeds
Wvtm 13 Schedule
Philip Markoff - Parents, Death & Facts
Vlad The Impaler Dick Size
H0Tdommymommygf
Scorpio Lucky Pick 3
2024 Busted VA Counties - Latest Arrests and Mugshots in Virginia
Craigslist Campers For Rent
Inyo Crime Graphics Bishop
Mccommons Funeral Home Obituaries
Jigme Khesar Namgyel Wangchuck Net Worth
Latest Posts
Article information

Author: Twana Towne Ret

Last Updated:

Views: 5978

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Twana Towne Ret

Birthday: 1994-03-19

Address: Apt. 990 97439 Corwin Motorway, Port Eliseoburgh, NM 99144-2618

Phone: +5958753152963

Job: National Specialist

Hobby: Kayaking, Photography, Skydiving, Embroidery, Leather crafting, Orienteering, Cooking

Introduction: My name is Twana Towne Ret, I am a famous, talented, joyous, perfect, powerful, inquisitive, lovely person who loves writing and wants to share my knowledge and understanding with you.