page246
333
CREATE OR REPLACE SECURE VIEW v_region COPY GRANTS
AS
SELECT r_regionkey,
r_name,
r_comment
FROM tpc.tpc_owner.region_baseline;
The
share_owner
database may contain objects sourced from many different
databases and schemas. The
share_owner
database is intended to be the container from
which your share is populated; you should containerize your objects for ease of later
maintenance and administration.
You cannot directly entitle your share called
share_poc
to access the new secure
view
v_region_baseline
using the role
share_owner_role
. Attempting to do so results
in the following error:
Share
'"<YOUR
ACCOUNT>.SHARE_POC"'
does
not
exist
or
not
authorized.
You must first switch the role.
USE ROLE securityadmin;
Then use
GRANT SELECT
on individual views.
GRANT SELECT ON tpc.share_owner.v_region TO SHARE share_poc;
An alternative approach is to create all the desired nonview objects and then entitle
all of them using a single command per object type.
GRANT SELECT ON ALL TABLES IN SCHEMA tpc.share_owner TO SHARE
share_poc;
GRANT SELECT ON ALL DYNAMIC TABLES IN SCHEMA tpc.share_owner TO SHARE
share_poc;
GRANT SELECT ON ALL MATERIALIZED VIEWS IN SCHEMA tpc.share_owner TO SHARE
share_poc;
To confirm entitlement and objects granted to your share
share_poc
, use this:
SHOW GRANTS TO SHARE share_poc;
Chapter 9
Client expeCtations