A consumer reports one of three things. The share isn't in their account. They mounted it but a table is missing or "does not exist or not authorized". Or a shared view worked yesterday and now fails. Nearly every case comes down to the share's grant list, which account the share was added to, or a provider change that dropped grants. Check on the provider side first, because the consumer can only see what the share exposes.
Quick map: symptom, cause, fix
| Symptom (consumer side) | Likely cause | Fix |
|---|---|---|
Share not listed in SHOW SHARES | Wrong account identifier added, or the consumer is in another region | Check SHOW GRANTS OF SHARE; for another region, use replication or a listing |
CREATE DATABASE ... FROM SHARE fails | Role lacks IMPORT SHARE / CREATE DATABASE | Use ACCOUNTADMIN or grant those privileges |
| Database mounted, users see nothing | IMPORTED PRIVILEGES not granted to their role | GRANT IMPORTED PRIVILEGES ON DATABASE ... TO ROLE ... |
| New table not visible | Future grants don't work for shares | Grant the object to the share explicitly |
| Table vanished after a deploy | CREATE OR REPLACE recreated it without the share grant | Re-grant, then check with SHOW GRANTS TO SHARE |
| Shared view fails, other databases referenced | Missing REFERENCE_USAGE on the referenced database | GRANT REFERENCE_USAGE ON DATABASE ... TO SHARE ... |
| Shared view returns zero rows | Row filter on CURRENT_ACCOUNT() doesn't match the consumer | Test with SIMULATED_DATA_SHARING_CONSUMER |
Check 1: does the share exist and who is it added to?
Run on the provider account as ACCOUNTADMIN or as the role that owns the share:
SHOW SHARES LIKE 'SALES_SHARE'; -- kind = OUTBOUND, check the "to" column
SHOW GRANTS OF SHARE sales_share; -- accounts the share is added to
SHOW GRANTS TO SHARE sales_share; -- objects and privileges in the share
Ask the consumer to run this and send you the output, so you know their exact identifier:
SELECT CURRENT_ORGANIZATION_NAME(), CURRENT_ACCOUNT_NAME(), CURRENT_REGION();
If the account in SHOW GRANTS OF SHARE doesn't match, add the right one:
ALTER SHARE sales_share ADD ACCOUNTS = myorg.partner_prod;
-- remove a wrong one
ALTER SHARE sales_share REMOVE ACCOUNTS = myorg.partner_dev;
Warning
ALTER SHARE ... SET ACCOUNTS = ...replaces the whole consumer list. Any account you leave out loses access immediately. UseADD ACCOUNTSandREMOVE ACCOUNTSfor routine changes.
Direct shares only work between accounts in the same region and cloud. If CURRENT_REGION() differs, adding the account won't help. Replicate the database to an account in the consumer's region and share from there, or publish a listing with cross-cloud auto-fulfillment. Check the current docs for your edition before you plan this.
Check 2: can the consumer mount it?
On the consumer account:
SHOW SHARES; -- look for kind = INBOUND
DESC SHARE myorg.provider_acct.sales_share; -- objects visible through the share
CREATE DATABASE sales_from_provider
FROM SHARE myorg.provider_acct.sales_share;
GRANT IMPORTED PRIVILEGES ON DATABASE sales_from_provider TO ROLE analyst;
By default only ACCOUNTADMIN has IMPORT SHARE. To let another role mount shares:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE data_admin;
GRANT CREATE DATABASE ON ACCOUNT TO ROLE data_admin;
When the database is mounted but analysts still get "Object does not exist or not authorized", the usual cause is that nobody granted IMPORTED PRIVILEGES to the analysts' role. A shared database is read-only, so the consumer can't grant on individual tables inside it. To give different roles different subsets, the provider has to share database roles. See the last section.
Check 3: is the object actually in the share?
A share needs three levels of grant. Missing any of them hides the object:
GRANT USAGE ON DATABASE sales TO SHARE sales_share;
GRANT USAGE ON SCHEMA sales.curated TO SHARE sales_share;
GRANT SELECT ON TABLE sales.curated.orders TO SHARE sales_share;
-- or every existing table in the schema
GRANT SELECT ON ALL TABLES IN SCHEMA sales.curated TO SHARE sales_share;
New tables don't appear
Future grants are not allowed for shares. GRANT SELECT ON FUTURE TABLES ... TO SHARE is rejected. You also can't add a future grant to a database role that is granted to a share. Every new table or view has to be granted explicitly. Put the GRANT ... TO SHARE statement in the same deployment script or dbt post-hook that creates the object.
A table disappeared after a deploy
CREATE OR REPLACE TABLE makes a new object. Grants on the old table, including the share grant, don't carry over unless you use COPY GRANTS. dbt table materialisations and many ETL tools recreate tables like this. Compare the share's grants with what should be there:
SHOW GRANTS TO SHARE sales_share;
SELECT "name", "privilege", "granted_on"
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))
WHERE "granted_on" IN ('TABLE', 'VIEW');
Re-run the grant for each missing object, then confirm it shows up in SHOW GRANTS TO SHARE. Don't assume COPY GRANTS put it back.
Tip
Make the share grants idempotent and run them at the end of every deployment.
GRANTon a privilege that already exists is a no-op, so running the whole list each time is safe and fixes drift.
Check 4: shared views that fail or return nothing
Only secure views can be added to a share by default. If you try to share a normal view, the grant is rejected. Convert it first:
ALTER VIEW sales.curated.v_orders SET SECURE;
GRANT SELECT ON VIEW sales.curated.v_orders TO SHARE sales_share;
The view references another database
A shared secure view can read tables in other databases only if the share holds REFERENCE_USAGE on each of them. Without it, the grant fails, or the view errors for the consumer:
GRANT REFERENCE_USAGE ON DATABASE reference_data TO SHARE sales_share;
The share grant is still made on the view itself. The referenced tables don't need SELECT granted to the share.
The view returns zero rows for one consumer
Multi-tenant shares often filter with CURRENT_ACCOUNT() against an entitlements table. If the consumer's account locator or name in that table is wrong, they get an empty result and no error. Test as the consumer from the provider account:
ALTER SESSION SET SIMULATED_DATA_SHARING_CONSUMER = 'PARTNER_PROD';
SELECT COUNT(*) FROM sales.curated.v_orders;
ALTER SESSION UNSET SIMULATED_DATA_SHARING_CONSUMER;
Check whether your filter compares against the account locator or the account name. CURRENT_ACCOUNT() returns the locator, and CURRENT_ACCOUNT_NAME() returns the name. Mixing the two is a common reason a consumer gets no rows.
Things a consumer can't do
These limits explain a lot of "it's broken" tickets that aren't bugs:
- Shared databases are read-only. No DML, no new objects, no grants on individual objects.
- Time Travel and cloning aren't available on shared objects. A consumer who needs history must copy the data into their own tables, for example with a scheduled
CREATE TABLE ... AS SELECT. - If the provider drops the share or removes the account, the consumer's mounted database stays but every query fails. Tell consumers before you remove an account.
Prevent it next time
- Keep share definitions in code:
CREATE SHARE, allGRANT ... TO SHAREstatements andADD ACCOUNTS, run after every deployment. - Share database roles instead of the whole database when consumers need different subsets, so the consumer can map each one to its own role:
CREATE DATABASE ROLE sales.finance_reader;
GRANT USAGE ON SCHEMA sales.curated TO DATABASE ROLE sales.finance_reader;
GRANT SELECT ON VIEW sales.curated.v_orders TO DATABASE ROLE sales.finance_reader;
GRANT DATABASE ROLE sales.finance_reader TO SHARE sales_share;
-- consumer side
GRANT DATABASE ROLE sales_from_provider.finance_reader TO ROLE finance_analyst;
- Add a daily check that compares
SHOW GRANTS TO SHAREwith the expected object list and alerts on missing objects. - Use
COPY GRANTSonCREATE OR REPLACEfor shared objects, and verify it in a non-production share first. - Before go-live, test every multi-tenant view with
SIMULATED_DATA_SHARING_CONSUMER, once for each consumer account.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get