Retrieve queries owned by a disabled user

How to retrieve queries owned by a disabled user in Databricks SQL.

Written by John.Lourdu

Last published at: March 4th, 2022

When a Databricks SQL user is removed from an organization, the queries owned by the user remain, but they are only visible to those who already have permission to access them.

A Databricks SQL admin can transfer ownership to other users, as well as delete alerts, dashboards, and queries owned by the disabled user account.

Clone a query

A Databricks SQL admin has view access to all queries by default. As an admin, you can view and delete any query.

You cannot edit a query, if it is not shared with you. This includes admin users.

The solution is to clone a query, and then edit the permissions.

Query menu

  1. Open Databricks SQL.
  2. Click Queries.
  3. Click Admin View.
  4. Select the query you want to clone.
  5. Click the vertical ellipsis and select Clone.

You can now edit the copy of the original query as needed.

Delete a query

  1. Open Databricks SQL.
  2. Click Queries.
  3. Click Admin View.
  4. Select the query you want to delete.
  5. Click the vertical ellipsis and select Move to Trash.
  6. Click Move to Trash to confirm.
Delete

Warning

When you delete a query, all alerts and dashboard widgets created with its visualizations are also deleted.


Was this article helpful?