page243
330
You can find more information on shares at
https://docs.snowflake.com/en/
user-guide/data-sharing-provider#preparing-to-create-a-share
.
Now create a new schema called
tpc.share_owner
to contain client-specific objects
for assignment to
share_poc
. In your real-world implementation, you may want to
rename
share_poc
to contain client-specific identifiers for ease of later identification.
USE ROLE sysadmin;
CREATE SCHEMA IF NOT EXISTS tpc.share_owner;
Create a new role to manage shared objects and assign them to yourself:
USE ROLE securityadmin;
CREATE OR REPLACE ROLE share_owner_role;
GRANT ROLE share_owner_role TO USER <YOUR USER HERE>;
Grant entitlement for the share to reference objects within the new schema called
tpc.share_owner
created earlier.
GRANT USAGE ON DATABASE tpc TO SHARE share_poc;
GRANT USAGE ON SCHEMA tpc.share_owner TO SHARE share_poc;
Grant entitlement to the new role called
share_owner_role
for creating objects in
the new schema
tpc.share_owner
.
GRANT USAGE ON DATABASE tpc TO ROLE share_owner_role;
GRANT USAGE ON SCHEMA tpc.tpc_owner TO ROLE share_owner_role;
GRANT USAGE ON SCHEMA tpc.share_owner TO ROLE share_owner_role;
Grant entitlement to the new role
share_owner_role
for accessing objects in both
existing schema the
tpc.tpc_owner
and the new schema
tpc.share_owner
.
GRANT SELECT ON ALL TABLES IN SCHEMA tpc.tpc_owner TO ROLE
share_owner_role;
GRANT SELECT ON ALL DYNAMIC TABLES IN SCHEMA tpc.tpc_owner TO ROLE
share_owner_role;
GRANT SELECT ON ALL TABLES IN SCHEMA tpc.share_owner TO ROLE
share_owner_role;
Chapter 9
Client expeCtations