SnowPro Advanced Administrator Cheatsheet
SnowPro Advanced Administrator
Download free PDFSecurity and access control
System roles and inheritance
- **USERADMIN** manages users and roles through its creation privileges. **SECURITYADMIN** inherits USERADMIN and holds **MANAGE GRANTS**, allowing account-wide grant administration.
- **SYSADMIN** manages warehouses and database objects. **ACCOUNTADMIN** inherits SYSADMIN and SECURITYADMIN; reserve it for account administration rather than routine object creation.
- **GRANT ROLE child TO ROLE parent** makes the parent inherit the child's privileges. Connect custom object-owner roles to the administrative hierarchy deliberately.
- **OWNERSHIP** belongs to one role and is inherited by roles above it. Creating an object uses the active primary role; having created it under ACCOUNTADMIN does not permanently bind its ownership there.
- **DROP ROLE** transfers owned objects to the role executing the command and removes grants involving the dropped role. Transfer ownership deliberately before retiring a role.
Object access and future grants
- To query a table, combine **USAGE on its database and schema**, **SELECT on the table**, and warehouse **USAGE**. Check the complete inherited privilege path when access fails.
- **ALL PRIVILEGES on a schema** grants applicable schema privileges, including creation rights; it does not grant access to every table in that schema or transfer ownership.
- A user's **DEFAULT_ROLE** is a session preference, not a role grant. Grant the role to the user before relying on **USE ROLE** or a default-role setting.
- **Future grants** affect newly created objects, not existing ones. For the same object type, schema-level future grants take precedence over database-level future grants in that schema.
- In a **managed access schema**, the schema owner or a role with MANAGE GRANTS controls object grants. Object owners retain object-management rights. **ALTER SCHEMA ... DISABLE MANAGED ACCESS** changes the access-management model.
Authentication and recovery
- For a temporary MFA recovery window, use **ALTER USER ... SET MINS_TO_BYPASS_MFA = 1440** for 24 hours. The bypass preserves enrollment; use a short window suited to the recovery need.
- **DISABLE_MFA** changes MFA enrollment behavior and is not a timed bypass. MFA requirements also apply to supported command-line clients; changing clients is not an authentication bypass.
- The **SQL API** supports **OAuth bearer tokens** and **key-pair JWT authentication**. Register the public key on the user and protect the private key; rotate credentials without embedding passwords in API requests.
- **OAuth security integrations** configure token trust, clients and allowed behavior. Creation requires the global **CREATE INTEGRATION** privilege, held by ACCOUNTADMIN by default; delegate it explicitly when needed.
SCIM provisioning
- **SCIM** provisions Snowflake users and roles from an identity provider. Supported client types include **Okta**, **Azure Active Directory / Microsoft Entra ID**, and **generic** for custom clients.
- A **TYPE = SCIM** security integration specifies **SCIM_CLIENT** and a **RUN_AS_ROLE** provisioner role. Keep ownership of provisioned users and roles aligned with that role so synchronization can manage them.
- **SYSTEM$GENERATE_SCIM_ACCESS_TOKEN('INTEGRATION_NAME')** generates a SCIM token valid for six months. Rotate the token in the identity provider before expiry; generating another token does not revoke earlier tokens.
- **Provisioning**, **authentication**, and **authorization** are separate: SCIM synchronizes identities, SSO authenticates them, and Snowflake role grants determine access. Reconcile manual identity changes with the provisioning source.
Network and exfiltration controls
- **Network policies** restrict incoming connections. SECURITYADMIN, ACCOUNTADMIN, or a role granted **CREATE NETWORK POLICY** can create them; organization administration does not itself grant account security privileges.
- A **user-level network policy** overrides an account-level policy for that user. Within an IP-list policy, a blocked address takes precedence over an overlapping allowed range.
- **Storage integrations** delegate cloud access without embedding long-lived cloud secrets in stages. Restrict **STORAGE_ALLOWED_LOCATIONS**, optional blocked locations, integration USAGE and cloud IAM permissions.
- **REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION** governs creation of private external stages; **REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION** governs their use. **PREVENT_UNLOAD_TO_INLINE_URL** closes a separate direct-unload route; stage controls and incoming network controls address different paths.
Masking and role context
- **Dynamic Data Masking** transforms column values at query time while preserving stored data. Reuse a policy across compatible columns; policy input and return types must match the protected value's type.
- Use **CURRENT_ROLE()** for the session's primary role. Use **IS_ROLE_IN_SESSION('ROLE')** when the rule should recognize active role inheritance rather than only an exact primary-role name.
- **INVOKER_ROLE()** evaluates the executing object's role; through a view this is the **view owner role**. Use it when masking depends on which view exposes a column. **IS_GRANTED_TO_INVOKER_ROLE** also evaluates that role's hierarchy.
- Owning or creating a masking policy does not automatically reveal unmasked values; the policy expression controls the result. Unset policy assignments before dropping a policy that is in use.
Account and resource governance
Organizations and account boundaries
- An **organization** groups Snowflake accounts across supported clouds and regions. Organization administration covers account creation, regional availability and organization-wide usage visibility.
- **ORGADMIN** is an organization administration role. Distinguish its cross-account scope from **ACCOUNTADMIN**, which administers a particular account; neither grants automatic access to every business dataset across the organization.
- Specify an **account name** when creating an account; it must be unique within the organization. Choose region, cloud and edition for residency, feature and operational requirements.
- **SHOW REGIONS** exposes available regions and **SHOW ORGANIZATION ACCOUNTS** inventories organization accounts. Cross-account usage views support central monitoring; each account still needs its own access design.
Credit quotas and operational limits
- A **resource monitor** tracks credit consumption against a quota. Assign one monitor to several warehouses for a combined budget; each warehouse has at most one directly assigned monitor, alongside any account-level monitor.
- Set **CREDIT_QUOTA**, **FREQUENCY** and **START_TIMESTAMP** for the intended interval. For an annual allowance, use **YEARLY** with a start aligned to the intended annual boundary.
- Threshold actions differ: **NOTIFY** sends an alert; **SUSPEND** allows running statements to finish; **SUSPEND_IMMEDIATE** cancels running statements and suspends the warehouses. Multiple thresholds can implement escalating controls.
- A quota-triggered suspension is not fixed by issuing RESUME alone. Raise the quota or change the applicable assignment, for example **ALTER WAREHOUSE ... UNSET RESOURCE_MONITOR**, under the approved cost policy.
- Resource monitors run without warehouse compute and account for associated cloud-services usage, but do not cap all serverless services. Threshold processing can lag consumption; a monitor is not an exact hard spending limit.
Delegate and record warehouse operations
- Warehouse **USAGE** permits query execution and auto-resume. **MONITOR** exposes warehouse activity and usage; **OPERATE** permits suspend/resume; **MODIFY** changes properties. Grant the smallest combination required.
- To capture configuration, run **SHOW WAREHOUSES**, then read its output with **RESULT_SCAN(LAST_QUERY_ID())**. **OBJECT_CONSTRUCT(*)** converts each output row into an object suitable for a VARIANT column.
- Persist inventory snapshots in an audit table rather than relying on transient command results. Keep configuration history separate from metering history, which measures actual consumption.
Performance and workload management
Scale the right compute dimension
- **Scale up** warehouse size for an individual query's CPU, memory or spill needs. **Scale out** with multiple clusters for concurrency and queue reduction; additional clusters do not combine to accelerate one query.
- A **multi-cluster warehouse** uses minimum and maximum cluster counts. Different values enable autoscaling; equal values run a fixed cluster count. Set the minimum for sustained demand and the maximum for bursts.
- Separate periodic heavy jobs from dashboard workloads using an appropriately sized warehouse. Query tuning and workload isolation can reduce queues more effectively than increasing every workload's compute.
- **AUTO_RESUME** starts suspended compute when work arrives. **AUTO_SUSPEND** applies when the warehouse becomes inactive; automatic scale-in of extra clusters is a separate multi-cluster behavior.
- Multi-cluster warehouses require **Enterprise Edition or higher**, including Business Critical. Match the scaling policy to latency versus credit cost and inspect actual load before changing cluster counts.
Persisted results and warehouse cache
- **Persisted query results** can satisfy eligible repeated queries without warehouse execution. Reuse depends on matching query text, unchanged contributing data, privileges and other eligibility conditions; it is not guaranteed.
- Standardize repeated report SQL and avoid unnecessary non-deterministic expressions. A shared warehouse or shared role alone does not guarantee result reuse; access to the underlying objects is still required.
- The **warehouse data cache** holds data read from storage on running compute. Similar queries scanning the same dataset can benefit even when their final results differ. Suspending the warehouse discards this cache.
- **AUTO_SUSPEND = 0 or NULL** disables automatic suspension and may preserve a warm data cache at the cost of idle compute. Persisted query results survive warehouse suspension; tune the two cache mechanisms separately.
Pruning and precomputed results
- **Micro-partition pruning** skips storage that cannot match predicates using partition metadata. Inspect partitions scanned, bytes scanned, spill and queue time in the query profile before choosing an optimization.
- Choose **clustering keys** for selective, repeated access patterns on large tables. Cardinality, value distribution and partition overlap matter; grouping by a key alone does not ensure selective pruning.
- A **skewed key** concentrates many rows under a few values, so filtering common values can still scan substantial data. Balance pruning gains against Automatic Clustering maintenance credits and storage churn.
- **Materialized views** store maintained results for supported definitions. The optimizer may rewrite a base-table query to use one, but cost-based selection is not guaranteed. Include background maintenance in the cost decision.
Data sharing and collaboration
Shares, listings and exchanges
- **Secure Data Sharing** exposes provider-managed data without a consumer copy in the same region. Consumers use their own compute; shared data remains read-only to them.
- **Marketplace listings** publish data products. Publicly available free data can be accessed directly when its terms allow; personalized or request-based access supports provider approval and tailored datasets.
- A **Data Exchange** is a controlled collaboration environment for selected members. Consumer acquisition requires **IMPORT SHARE** and **CREATE DATABASE** privileges or the appropriate administrative role.
- **Reader accounts** serve consumers without their own Snowflake account and are managed by the provider. For existing Snowflake customers, prefer direct sharing or listings rather than provisioning unnecessary reader accounts.
Secure views and consumer authorization
- Use **secure views** to expose selected rows and columns without exposing the base tables directly. **CURRENT_ACCOUNT()** can drive account-specific row filtering for consumers; producer role names are not consumer identities.
- **SIMULATED_DATA_SHARING_CONSUMER** sets the consumer account context for testing secure shared views. Test each entitlement path and verify both allowed and excluded rows.
- For an imported database, **IMPORTED PRIVILEGES** grants access to the provider's shared privileges as a bundle. Provider-shared **database roles**, when available, support more granular consumer grants.
- If finer local control is needed for a coarse-grained share, place local views over the imported data and grant those views to business roles. Keep direct imported-data privileges limited to the roles supporting that access layer.
Files, regions and stable contracts
- For **unstructured data**, expose supported file-access URLs through a secure view over staged-file metadata. A file path or stage name alone does not authorize access; **pre-signed URLs** are time-limited bearer access and must be protected.
- Use local shares for **same-region** collaboration. Cross-region or cross-cloud delivery requires replication or supported listing fulfillment, adding transfer, storage and refresh costs; retain required residency boundaries.
- **Dropping a column** or **renaming a shared object** can break consumer queries. Coordinate contract changes, deprecate carefully and preserve compatible views where practical. Unpublishing a listing and changing its data schema are separate operations.
Data management and protection
Time Travel and safe recovery
- **DATA_RETENTION_TIME_IN_DAYS** controls recoverable history and can be set at account, database, schema or table scope. Explicit lower-level settings override inherited defaults, subject to any account minimum.
- For permanent tables, **Standard Edition** supports up to one day of Time Travel; **Enterprise or higher** supports up to 90 days. Temporary and transient tables support at most one day and have no Fail-safe.
- Query history with **AT(TIMESTAMP => ...)** or **AT(OFFSET => -1800)**. Use **BEFORE(STATEMENT => 'query_id')** to recover the state immediately before a completed destructive statement.
- Create an isolated recovery copy with **CREATE TABLE restore_t CLONE live_t BEFORE(STATEMENT => 'query_id')**. Validate it before changing production. **UNDROP** restores eligible dropped objects, not the contents of a truncated table.
- Give related facts and dimensions compatible retention windows and restore them at a **common point in time**. Time Travel supports user recovery; **Fail-safe** is Snowflake-managed disaster recovery for eligible permanent data.
Zero-copy cloning and references
- **Zero-copy cloning** initially shares existing micro-partitions for standard Snowflake tables. Source and clone then change independently; retained shared partitions and later changes affect storage cost.
- Cloning a **database or schema** together preserves supported internal relationships, including view and sequence references to objects inside that clone boundary. References outside the boundary can still target source objects.
- For lower environments, inspect object references, privileges and scheduled operations before access is granted. A metadata clone is not a blanket guarantee that every integration or external dependency has been isolated.
Database replication and refresh
- Database replication creates a **secondary database** from a primary in an authorized account, including across supported clouds and regions. Configure organization/account eligibility and explicit replication permission before creating the replica.
- In the primary account, **ALTER DATABASE ... ENABLE REPLICATION TO ACCOUNTS ...** authorizes targets. In a target, **CREATE DATABASE ... AS REPLICA OF ...** creates the secondary; **ALTER DATABASE secondary_db REFRESH** pulls later changes from that target account.
- A secondary database is **read-only** until promoted through a supported failover configuration. Refresh frequency affects freshness and recovery-point exposure; replication and failover privileges are separate from ordinary query access.
- **Time Travel history is not copied** from primary to secondary. Secondary history reflects its refreshes. Database-level retention can be set separately; explicit schema/table retention parameters replicate and can override that database default.
- Replication cost includes **changed data**, refresh compute, data transfer and secondary storage. Frequent refreshes and high-churn tables can increase costs because changed micro-partitions must be synchronized; inspect replication usage history.
- Independent database refreshes do not guarantee a consistent point across databases. Use a supported **replication or failover group** when related databases must refresh together; replication does not make a received share a freely replicable local source.
Stages, streams and task operations
- A shared, rebuildable staging area can use a **transient table** with zero retention to reduce historical-storage cost. A **temporary table** is session-scoped; table type alone does not guarantee faster transformations.
- **External tables** expose metadata over files held in cloud storage rather than ingesting their contents into ordinary Snowflake tables. Keep file metadata refreshed and distinguish file access from Snowflake-managed table storage.
- Prefer **staged bulk loading with COPY INTO** over large numbers of tiny INSERT statements where possible. Batch work and measure contention before selecting warehouse size or adding concurrency.
- Creating a **stream** requires database/schema USAGE, **CREATE STREAM on the schema**, and required source privileges such as SELECT on a table. Source change tracking must be enabled; its initial enablement can require source ownership.
- For task operations, grant database/schema **USAGE** and task **OPERATE** for suspend/resume. Task definition changes require ownership; the account-level **EXECUTE TASK** privilege governs the owner's ability to run tasks.
- Snowflake uses **READ COMMITTED** isolation: a transaction sees its own uncommitted writes, and statements see committed data at their start. Reads generally avoid write locks, but conflicting writes can block or deadlock; keep transactions short.