Getting Started with Secure Data Sharing¶
Secure Data Sharing is an extremely powerful, yet easy-to-use feature. You can get started as a data provider in just a few simple steps.
This topic introduces the tasks required to share a database and its objects with one or more accounts. The example at the end of the topic illustrates all the SQL commands required to perform these tasks.
In this Topic:
To perform the tasks described in this topic, you must use the ACCOUNTADMIN role.
Also, this topic describes only the minimum set of tasks required for providers to start sharing data. For more detailed information, including more detailed data sharing scenarios, see Working with Shares.
The following example illustrates the entire provider process as described above.
Note that this example assumes:
A database named
sales_dbexists with a schema named
aggregates_eulaand a table named
The database, schema, and table will be shared with two accounts named
yz23456.USE ROLE accountadmin; CREATE SHARE sales_s; 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; SHOW GRANTS TO SHARE sales_s; ALTER SHARE sales_s ADD ACCOUNTS=xy12345, yz23456; SHOW GRANTS OF SHARE sales_s;