Let engineers build and keep reporting approvals consistent
Ravi’s engineering role creates report tables. On a shared production schema, every table creator making their own access decisions would make reviews difficult. The security team wants one place to approve report readers while engineers keep the ability to maintain their objects.
In a regular schema, the object owner can usually grant object privileges. In a managed access schema, the schema owner or a role with MANAGE GRANTS manages object privileges, including future grants. An object creator can still own and maintain the object within its privileges. Schema owners must still grant the read path to approved roles.
Choose managed access for a boundary with recurring access reviews or consistent approval rules. A disposable team sandbox may use a regular schema to let developers control their own objects. Managed access changes grant authority. Decide separately which users may read each table.
| Role and authority | Regular schema | Managed access schema |
|---|---|---|
| Engineer owns the table only | Can grant | Cannot grant |
| Schema owner only | Needs separate grant authority on the table | Can grant |
| Role with MANAGE GRANTS | Can grant | Can grant |
Test the same grant as two different owners
Use a disposable account, a lab operator with SYSADMIN and SECURITYADMIN, and an approved M17_LAB_WH. Replace the operator and warehouse names. The creator will own a table containing one order. The schema owner controls who can read it. Use fresh names so cleanup can target the objects from this lab.
Give a builder the right to create a table
SYSADMIN creates the database and managed schema. SECURITYADMIN creates and assigns the custom roles. GRANT CREATE TABLE is scoped to the schema. Warehouse and parent USAGE allow each role to reach its approved work. Neither job role has MANAGE GRANTS.
USE ROLE SYSADMIN;
CREATE DATABASE M17D_MANAGED;
CREATE SCHEMA M17D_MANAGED.REPORTING WITH MANAGED ACCESS;
USE ROLE SECURITYADMIN;
CREATE ROLE M17D_BUILDER;
CREATE ROLE M17D_MANAGED_READER;
GRANT ROLE M17D_BUILDER TO USER <TEST_OPERATOR>;
GRANT ROLE M17D_MANAGED_READER TO USER <TEST_OPERATOR>;
GRANT USAGE ON WAREHOUSE M17_LAB_WH TO ROLE M17D_BUILDER;
GRANT USAGE ON WAREHOUSE M17_LAB_WH TO ROLE M17D_MANAGED_READER;
GRANT USAGE ON DATABASE M17D_MANAGED TO ROLE M17D_BUILDER;
GRANT USAGE ON DATABASE M17D_MANAGED TO ROLE M17D_MANAGED_READER;
GRANT USAGE ON SCHEMA M17D_MANAGED.REPORTING TO ROLE M17D_BUILDER;
GRANT USAGE ON SCHEMA M17D_MANAGED.REPORTING TO ROLE M17D_MANAGED_READER;
GRANT CREATE TABLE ON SCHEMA M17D_MANAGED.REPORTING TO ROLE M17D_BUILDER;
SHOW GRANTS TO ROLE M17D_BUILDER;Prove the table owner cannot grant SELECT
With secondary roles off, the builder creates and reads order 101 as table owner. The same builder’s GRANT should fail. Run it by itself. Then SYSADMIN, the schema owner, issues the same grant. SHOW GRANTS ON TABLE should show the builder as owner and the reader holding SELECT. The reader’s SELECT should return 101.
USE ROLE M17D_BUILDER;
USE SECONDARY ROLES NONE;
USE WAREHOUSE M17_LAB_WH;
CREATE TABLE M17D_MANAGED.REPORTING.ORDERS AS SELECT 101 AS order_id;
SELECT order_id FROM M17D_MANAGED.REPORTING.ORDERS;
-- Expected denial. Run alone.
GRANT SELECT ON TABLE M17D_MANAGED.REPORTING.ORDERS TO ROLE M17D_MANAGED_READER;
USE ROLE SYSADMIN;
GRANT SELECT ON TABLE M17D_MANAGED.REPORTING.ORDERS TO ROLE M17D_MANAGED_READER;
SHOW GRANTS ON TABLE M17D_MANAGED.REPORTING.ORDERS;
USE ROLE M17D_MANAGED_READER;
USE WAREHOUSE M17_LAB_WH;
SELECT order_id FROM M17D_MANAGED.REPORTING.ORDERS;Remove the practice schema and roles
Confirm the managed database is the one you created. SYSADMIN drops it. SECURITYADMIN revokes the two temporary memberships and drops both job roles. The supplied warehouse stays in place.
USE ROLE SYSADMIN;
DROP DATABASE M17D_MANAGED;
SHOW DATABASES LIKE 'M17D_MANAGED';
USE ROLE SECURITYADMIN;
REVOKE ROLE M17D_BUILDER FROM USER <TEST_OPERATOR>;
REVOKE ROLE M17D_MANAGED_READER FROM USER <TEST_OPERATOR>;
DROP ROLE M17D_BUILDER;
DROP ROLE M17D_MANAGED_READER;Keep the approval boundary during a release
A failed grant in a release can mean the automation role owns the table but not the managed schema. Review the ownership of both objects and whether the schema is managed. Send the grant step to the approved grant owner instead of assigning MANAGE GRANTS to the release job.
Changing a live schema requires a migration plan. To enable managed access on an existing schema, review the ALTER SCHEMA command and its requirements, inventory existing grants, and test the new grant owner’s workflow. Existing queries still depend on their grants. Future OWNERSHIP in a managed schema can target only a subordinate role of its owner.
Explain the design in an interview
Name the rule, then explain how you would prove it.
What does WITH MANAGED ACCESS change?
It centralizes decisions about object grants. My engineering role may keep ownership and maintain its table, while the schema owner or a grant administrator approves readers.
How would you diagnose a failed release grant?
I would check the active role and schema type, then compare schema ownership and table ownership. I would run the grant as the authorized owner and retest as the intended reader.
Words used in this lesson
- Managed access schema
- A schema that centralizes object grants under its owner or a role with MANAGE GRANTS.
- MANAGE GRANTS
- Global privilege that allows grant administration.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Snowflake Managed Access Schemas: Separate Ownership and Grants
Create the table
The engineer can own a table inside the managed schema.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Create the table
The engineer can own a table inside the managed schema.
Engineer → Creates ORDERS → Table owner
- Approve readers
The schema owner or grant administrator controls the object grants.
Approval request → Managed schema owner → Approved reader
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Identify the owner of the schema and the owner of the table
SHOW GRANTS ON SCHEMA M17D_MANAGED.REPORTING;
SHOW GRANTS ON TABLE M17D_MANAGED.REPORTING.ORDERS;What to expect and why
Run after the setup using an authorized reviewer. Expect SYSADMIN to own the managed schema and M17D_BUILDER to own the table. The schema owner issues the reader grant in this lab.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
A developer needs to create a scratch table and choose who sees it. Pick the environment for that exercise.
Compare your reasoning
Use an approved regular sandbox schema with no production data. Its owner and maintainers can work within the sandbox boundary.
Official sources and curriculum
Module 17 · See module scope
By Rohit Ray · Independent educational lesson · Explore this visual lab