Home / Databricks on Azure

Databricks on AzureHow-toBeginner

Databricks system tables missing, empty or access denied: enable system schemas and grant access on Azure

Cost and job queries fail because system.billing or system.access is missing or you get PERMISSION_DENIED. Check schema state, enable the schemas you need, and grant read access safely.

Deepak Bhardwaj7 min read

Applies toAzure Databricks Premium with Unity Catalog, Databricks CLI (new, 0.205+), Databricks SQL and Databricks Runtime 13.3 LTS and later

The goal

You want to run a cost, job reliability or audit query against system.billing.usage, system.lakeflow.job_run_timeline or system.access.audit. Instead you get one of these:

  • [TABLE_OR_VIEW_NOT_FOUND] or [SCHEMA_NOT_FOUND] for system.<schema>
  • PERMISSION_DENIED: User does not have USE SCHEMA on Schema 'system.billing'
  • The system catalog doesn't appear in Catalog Explorer at all
  • The query runs but returns no rows for your workspace

System tables are part of Unity Catalog. They live in the system catalog, and each system schema has to be enabled on the metastore before it shows up. Even after a schema is enabled, only admins can read it until someone grants access. This post covers both steps.

Before you start

Requirement How to check
The workspace is attached to a Unity Catalog metastore SELECT current_metastore(); returns a value
You are an account admin or metastore admin (needed to enable schemas) Account console, or ask the platform team
The Databricks CLI is installed and authenticated databricks current-user me
A SQL warehouse or Unity Catalog compute to run queries Serverless, standard or dedicated access mode

Users who are both account admin and metastore admin can read system tables by default. Everyone else needs explicit grants.

Step 1: find the metastore ID

From SQL:

SELECT current_metastore();
-- returns something like azure:westeurope:1a2b3c4d-....
-- the metastore ID is the part after the last colon

Or from the CLI:

databricks metastores current --output json | jq -r '.metastore_id'

Save it in a variable for the next commands:

METASTORE_ID=$(databricks metastores current --output json | jq -r '.metastore_id')

Step 2: check which system schemas are enabled

databricks system-schemas list "$METASTORE_ID" --output json \
  | jq -r '.[] | "\(.schema)\t\(.state)"'

The state column tells you what to do next:

State Meaning Action
ENABLE_COMPLETED Enabled and visible in the system catalog Go to grants (Step 4)
AVAILABLE (or blank) Can be enabled, but isn't yet Enable it (Step 3)
ENABLE_INITIALIZED Enable in progress Wait a few minutes, list again
MANAGED Managed by Databricks, enabled automatically Go to grants
UNAVAILABLE Not offered for this metastore or region Check the system tables reference for availability

The schemas offered, and which ones are on by default, change over time and depend on when your metastore was created. Rely on the list output rather than a fixed list.

Step 3: enable the schemas you need

Only enable the schemas you will actually query. Common ones for operations:

Schema Typical tables Used for
billing usage, list_prices DBU cost by job, warehouse, tag
compute clusters, node_timeline, warehouse_events Right-sizing, idle clusters
lakeflow jobs, job_run_timeline, job_task_run_timeline Job failure rates, durations
query history Slow and failed SQL queries
access audit, table_lineage, column_lineage Security reviews, impact analysis
for s in billing compute lakeflow query access; do
  databricks system-schemas enable "$METASTORE_ID" "$s"
done

databricks system-schemas list "$METASTORE_ID" --output json \
  | jq -r '.[] | select(.state=="ENABLE_COMPLETED") | .schema'

Pass the short schema name (billing, not system.billing). Table and schema names vary by release. For example, older documentation refers to system.workflow, and today the jobs tables are under system.lakeflow. Check the current reference before you build dashboards on a specific table.

Tip

Enabling a schema doesn't backfill your history immediately. A freshly enabled schema can take a while to fill, and how far back each table goes depends on that table's retention. Check the reference for each table before you promise anyone a 12-month cost report.

Step 4: grant read access

System tables can contain sensitive data. system.access.audit shows who did what, from which IP. system.query.history contains query text. Grant per schema to groups, never to account users as a blanket rule.

-- Needed by everyone who reads any system table
GRANT USE CATALOG ON CATALOG system TO `platform-ops`;

-- Cost and compute: platform and FinOps
GRANT USE SCHEMA, SELECT ON SCHEMA system.billing  TO `platform-ops`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.compute  TO `platform-ops`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.lakeflow TO `platform-ops`;

-- Audit and query text: security team only
GRANT USE CATALOG ON CATALOG system TO `security-ops`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.access TO `security-ops`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.query  TO `security-ops`;

SHOW GRANTS ON SCHEMA system.billing;

Grant to the service principal that runs scheduled cost or alerting jobs as well. Otherwise the dashboard works for you and fails as a job.

Warning

system.billing.usage and several other tables cover every workspace in the account, not just the one you're in. Granting a team SELECT on the schema shows them every business unit's spend. For per-team access, use the views in the next step.

Share a filtered slice with a team

Create a view in a catalog you control, filtered to the team's workspace or tag, and grant that instead:

CREATE OR REPLACE VIEW ops.reporting.sales_dbu_usage AS
SELECT usage_date, workspace_id, sku_name, usage_quantity,
       usage_metadata.job_id, custom_tags
FROM system.billing.usage
WHERE custom_tags['cost_center'] = 'sales';

GRANT USE CATALOG ON CATALOG ops TO `sales-data-leads`;
GRANT USE SCHEMA ON SCHEMA ops.reporting TO `sales-data-leads`;
GRANT SELECT ON VIEW ops.reporting.sales_dbu_usage TO `sales-data-leads`;

The view owner needs SELECT on the underlying system table. The readers don't.

Step 5: verify with a smoke-test query

-- Should return rows for the last few days
SELECT usage_date, sku_name, ROUND(SUM(usage_quantity), 2) AS dbus
FROM system.billing.usage
WHERE usage_date >= current_date() - INTERVAL 7 DAYS
GROUP BY ALL
ORDER BY usage_date DESC, dbus DESC
LIMIT 20;

-- Which workspaces appear in the data at all
SELECT workspace_id, MAX(usage_date) AS latest
FROM system.billing.usage
GROUP BY workspace_id;

When it still doesn't work

Symptom Likely cause Fix
SCHEMA_NOT_FOUND: system.billing Schema not enabled databricks system-schemas enable $METASTORE_ID billing
PERMISSION_DENIED ... USE SCHEMA Enabled, but no grant GRANT USE SCHEMA, SELECT ON SCHEMA ...
PERMISSION_DENIED ... USE CATALOG on system Catalog-level grant missing GRANT USE CATALOG ON CATALOG system ...
enable call returns 403 You aren't an account or metastore admin Have an admin run it, or assign the metastore admin role to a group
No system catalog in a workspace Workspace not attached to a metastore, or a legacy cluster Attach the metastore; use Unity Catalog compute
Table exists, but no rows for one workspace That workspace is in a different region or on another metastore, or the data hasn't arrived yet Query from a workspace on that region's metastore; wait and recheck
system.lineage or system.operational_data is empty These schemas are deprecated Use system.access.table_lineage and the current tables

Prevent it next time

  • Put schema enablement and the system grants into your platform Terraform or bootstrap script, so every new metastore gets the same setup. The grants are ordinary Unity Catalog grants on the system catalog.
  • Manage grants through groups (platform-ops, security-ops, finops), and include the service principals that run scheduled reports.
  • Give business teams filtered views in your own catalog, never direct SELECT on account-wide schemas.
  • Re-run databricks system-schemas list after major platform announcements. New schemas appear over time and some old ones get deprecated.
  • Add the smoke-test query to a daily job with a failure alert. If the grants or the schema state change, you find out before the monthly cost review does.