レイクハウスフェデレーションの接続を管理する
この記事では、 メタストアで定義されているすべてのレイクハウスフェデレーション接続を一覧表示する方法、接続の詳細を取得する方法、接続アクセス許可を付与する方法、およびノートブックまたはUnity Catalog SQLDatabricks SQLクエリ エディターの Catalog Explorer と ステートメントを使用して接続を削除する方法について説明します。 接続 は、外部データベース システムにアクセスするためのパスと資格情報を指定する Unity Catalog のセキュリティ保護可能なオブジェクトです。
「接続の作成」も参照してください。
REST API を使用する場合は、 Databricks のリファレンス ドキュメントを参照してください。
接続の一覧表示
必要な権限 :返される接続のリストは、あなたの役割と権限によって異なります。 メタストアで USE CONNECTION
権限を持つユーザーには、すべての接続が表示されます。 それ以外の場合は、自分が接続オブジェクトの所有者であるか、何らかの権限を持っている接続のみを表示できます。
- Catalog Explorer
- SQL
-
In your Databricks workspace, click
Catalog.
-
At the top of the Catalog pane, click the
gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
The connections you have permission to see are listed, along with the URL, create date, owner, and comment.
Run the following command in a notebook or the Databricks SQL query editor. Optionally, replace <pattern>
with a LIKE
predicate.
SHOW CONNECTIONS [LIKE <pattern>];
接続の詳細を取得する
必要なアクセス許可 : 接続の所有者、メタストアに対する USE CONNECTION
特権、または接続に対する何らかの特権。
- Catalog Explorer
- SQL
-
In your Databricks workspace, click
Catalog.
-
At the top of the Catalog pane, click the
gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
-
Find the connection and select it to view details.
Run the following command in a notebook or the Databricks SQL query editor.
DESCRIBE CONNECTION <connection-name>;
接続に対するアクセス許可の付与と取り消し
接続を使用してフォーリンカタログを作成したり、接続の詳細を表示したりする権限を付与できます。
CREATE FOREIGN CATALOG
フォーリンカタログを、接続によって記述された DATA 内のデータベースの読み取り専用ミラーとして作成する権限を付与します。USE CONNECTION
DLT の接続を使用して、データソースから Databricksにデータを取り込む権限を付与します。 ただし、メタストア レベルで付与された場合は、メタストア内の接続の詳細を表示することしかできません。ユーザーがそれらを使用するには、個々の接続に対するUSE CONNECTION
が引き続き付与されている必要があります。
必要な権限 : メタストア管理者または接続所有者。
- Catalog Explorer
- SQL
To grant permission to use a connection:
-
In your Databricks workspace, click
Catalog.
-
At the top of the Catalog pane, click the
gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
-
Find the connection and select it.
-
On the Permissions tab, click Grant.
-
On the Grant on
<connection-name>
dialog, start typing the user or group name or click the user menu to browse and select users and groups. -
Select the privileges you want to grant.
See the privilege descriptions in the section introduction.
-
Click Grant.
To revoke a connection privilege:
- Follow the preceding steps to get to the Permissions tab for the connection.
- Select the user or group whose privilege you want to revoke.
- Click Revoke both on the tab and on the confirmation dialog.
To grant the ability to create a foreign catalog using a connection, run the following command in a notebook or the Databricks SQL query editor.
GRANT CREATE FOREIGN CATALOG ON CONNECTION <connection-name> TO <user-name>;
To grant the ability to view the connection, run the following:
GRANT USE CONNECTION ON CONNECTION <connection-name> TO <user-name>;
To revoke a privilege, run the following, where <privilege>
is one of the privileges on the connection granted to the user:
REVOKE <privilege> ON CONNECTION <connection-name> FROM <user-name>;
接続のドロップ
必要な権限 : 接続所有者
- Catalog Explorer
- SQL
-
In your Databricks workspace, click
Catalog.
-
At the top of the Catalog pane, click the
gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
-
Find the connection and select it.
-
Click the
kebab menu and select Delete.
-
On the confirmation dialog, click Delete.
Run the following command in a notebook or the Databricks SQL query editor.
DROP CONNECTION [IF EXISTS] <connection-name>;