Home > Software design >  create db from share from different role in reader account Snowflake
create db from share from different role in reader account Snowflake

Time:08-12

I have a share(i.e. shareTest_share) in accountAdmin role in one of my reader accounts in snowflake.

Now I want to create a database from this, but from sysAdmin role.

The statement for creating database is:

CREATE or replace DATABASE shareTest_db FROM SHARE mukulanalytics.shareTest_share

This is giving permission issue since I am trying to execute it from the sysAdmin role instead of accountAdmin role which has the access to shareTest_share share.

Error:

SQL access control error: Insufficient privileges to operate on foreign share 'SHARETEST_SHARE'

How can I create a database from share in a different role with share in another role?

CodePudding user response:

You will have to grant the IMPORT SHARE privilege to SYSADMIN/any other users

use role accountadmin

grant import share on account to sysadmin

use role sysadmin

create database TEST from share <>

https://docs.snowflake.com/en/user-guide/security-access-privileges-shares.html

CodePudding user response:

the privileges required to achieve this are described here: https://docs.snowflake.com/en/user-guide/security-access-privileges-shares.html

  • Related