您可以建立、更新、移除及共用資料來源連線。具備「DV 內容作者」存取權的 Oracle Analytics 使用者可執行這些動作。
主題:
您可以更新資料來源的連線詳細資訊。
如果您要編輯與 Oracle Database 的 SSL 連線,而需要使用新的 cwallet.sso
檔案,請在從屬端公事包欄位中,按一下選取來瀏覽 cwallet.sso
檔案。請向您的管理員詢問 cwallet.sso
檔案的位置。
您可以從 Oracle Analytics Cloud 移除資料來源連線。例如,您必須在資料庫密碼變更時,刪除資料庫連線並建立新連線。
如果連線包含任何資料集,您必須先刪除資料集,才能刪除連線。
使用「建立連線」或「檢查」對話方塊指定連線詳細資訊時,有些資料庫類型會有額外的組態選項。
一般選項
sales.example.com =(DESCRIPTION= (ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON) (ADDRESS=(PROTOCOL=tcp)(HOST=123.45.67.111)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=123.45.67.222)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=123.45.67.333)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME= salesservice.example.com)))
啟用大量複製 - 若是載入工作簿的資料集,必須將此選項關閉,因此您可以忽略此選項。此選項是保留供資料分析人員和進階使用者在兩個資料庫之間複製資料時使用。
認證選項
系統連線
如果您想要在「語意模型產生器」或「模型管理工具」中使用這些連線詳細資訊,請選取系統連線。
按一下複製以複製連線的物件 ID。業務模型建立者可將其貼至物件 ID,以在模型管理工具 (「連線集區」對話方塊) 識別並使用資料連線。
注意:若最初建立連線時未按一下系統連線,如果您之後希望資料模型建立者使用該連線詳細資訊,就必須建立新的連線並選取系統連線。也就是說,您之後無法編輯連線並選取此選項。
建立資料庫連線前,請先瞭解資料庫連線需求。
在 Oracle Analytics 中顯示的資料庫表格數目上限為 10,000。如果您需要額外表格,Oracle 建議您洽詢資料庫管理員,以建立可存取您要分析之特定物件的資料庫使用者,並在建立資料庫連線時,指定該使用者的證明資料。
如果是連線至 Oracle Database、Oracle Autonomous Data Warehouse、Oracle Transaction Processing、Snowflake、SQL Server 或 My SQL,您可以變更預設的引號識別碼,以便讀取表格或資料欄名稱中,使用大寫、小寫或混合大小寫字元的資料。
select "EfG_Field" from "AbCd";
,而不是發出 select EfG_Field from AbCd;
(這會導致失敗)。您可以使用 Oracle Analytics Cloud REST API 以程式設計的方式管理各種資料來源的連線。例如,您可能想要建立一個命令檔,以便同時在測試和生產 Oracle Analytics Cloud 環境建立 (或修改) 同一組連線。
您可以使用 REST API 建立、更新和刪除各種資料來源連線。本主題列出可以使用 REST API 管理的資料來源連線類型。
支援的資料來源
連線參數
每個資料來源需要的連線參數不同。若您要使用 REST API 建立或更新連線,必須瞭解資料來源所需的 JSON 有效負載格式。請參閱資料來源的範例 JSON 有效負載。
下列是開始使用 Oracle Analytics Cloud REST API 以程式設計方式管理連線的一般作業。如果您是第一次使用 REST API,請依照下列作業進行。
作業 | 描述 | REST API 文件 |
---|---|---|
瞭解先決條件 |
瞭解並完成多個先決條件作業。 您必須具有建立工作簿和連線至 Oracle Analytics Cloud 資料的許可權,才能使用 REST API 管理資料連線 (DV 內容作者)。 |
先決條件 |
瞭解 OAuth 2.0 權杖認證 | Oracle Analytics Cloud 的認證和授權由 Oracle Identity Cloud Service 管理。若要存取 Oracle Analytics Cloud REST API,您需要使用 OAuth 2.0 存取權杖獲得授權。 | OAuth 2.0 Token Authentication |
瞭解支援的資料來源 | 閱讀相關主題以瞭解可以使用 REST API 管理的資料連線類型。 | 支援的資料來源 |
決定 JSON 有效負載格式 | 閱讀相關主題以瞭解資料來源適用的 JSON 有效負載格式,並取得所需的連線參數。 | 資料來源的範例 JSON 有效負載 |
建立連線 | 建立資料連線以用於工作簿、報表和儀表板。 | Create a connection (預覽版) |
更新連線 | 更新現有資料連線的一或多個特性。 | Update a connection (預覽版) |
刪除連線 | 刪除資料連線。 | Delete a connection (預覽版) |
請使用以下範例瞭解如何使用 cURL 管理 REST API 要求的資料來源連線。
範例 cURL 格式
curl --header "Authorization: Bearer <token>" --header "Content-Type: application/json" --request POST|PUT https://<hostname>/api/20210901/catalog/connections --data "<data source connection payload>"
curl --header "Authorization: Bearer <token>" --request POST|PUT https://<hostname>/api/20210901/catalog/connections --form "cert=<security wallet file>" --form "connectionParams=<data source connection payload>"
<token> - 認證 Oracle Analytics Cloud REST API 呼叫所需的 OAuth 2.0 Bearer 權杖。請參閱 OAuth 2.0 Token Authentication。
<hostname> - 執行 Oracle Analytics Cloud 的主機。
<data source connection payload> - 資料來源特定連線資訊。請參閱資料來源的範例 JSON 有效負載。
<security wallet file> - 儲存 SSL 相關資訊,例如認證和簽署證明資料、私密金鑰、憑證和信任憑證。某些連線類型需要此項目,例如使用 SSL 的 Oracle Database 和 Oracle Autonomous Data Warehouse (雙向 TLS)。
範例
下列範例說明如何建立與 Oracle Autonomous Data Warehouse (ADW) 的連線。
cwallet.sso
(雙向 TLS) 建立與 Oracle ADW 的連線如需其他範例,請參閱 Oracle Analytics Cloud REST API。請參閱 Create a connection (預覽版)、Update a connection (預覽版) 和 Delete a connection (預覽版)。
註:
這些範例中的 JSON 有效負載僅適用於 Oracle ADW。其他資料來源使用不同的 JSON 有效負載格式。請參閱受支援資料來源的範例 JSON 有效負載。
範例 1 建立與 Oracle ADW 的無公事包 (TLS) 連線
oracle_adw_walletless
的連線。要求主體包含簡單 JSON application/json
。
curl --header "Authorization: Bearer <token>" --header "Content-Type: application/json" --request POST https://example.com/api/20210901/catalog/connections --data "{ "version": "2.0.0", "type": "connection", "name": "oracle_adw_walletless", "description": "Sample Oracle ADW connection without a wallet created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-autonomous-data-warehouse", "connectionString": "(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=abcdefg1hijkl2m_adwwalletless_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))", "username": "ADMIN", "password": "<<password>>", "systemConnection": false, "remoteData": false, "sslType": "ServerSideSSL" } } }"
回應主體
{"connectionID":"J0FkbWluJy4nb3JhY2xlX2Fkd193YWxsZXRsZXNzJw=="}
記下回應主題中 base64 編碼的 connectionId
。之後,您可以使用這個值更新或刪除連線。
範例 2 使用公事包檔案 (雙向 TLS) 建立與 Oracle ADW 的連線
oracle_adw_with_wallet
的連線。要求主體包含 multipart/form-data
,也就是同時需要 Oracle ADW (cwallet.sso
) 公事包檔案和 Oracle ADW 連線參數。
curl --header "Authorization: Bearer <token>" -–request POST https://<hostname>/api/20210901/catalog/connections --form "cert=@"/Users/scott/Downloads/Wallet_adw/cwallet.sso"" --form "connectionParams= "{ "version": "2.0.0", "type": "connection", "name": "oracle_adw_with_wallet", "description": "Sample Oracle ADW connection with a wallet created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-autonomous-data-warehouse", "connectionString": "(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps) (port=1522)(host=adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=abcdefg1hijkl2m_walletadw_high.adwc.oraclecloud.com/))(security=(ssl_server_dn_match=yes)))", "username": "ADMIN", "password": "<<password>>", "remoteData": "false", "systemConnection": false, "sslType": "ClientSideSSL" } } }"
回應主體
{"connectionID":"J2FkbWluJy4nb3JhY2xlX2Fkd193aXRoX3dhbGxldCc="}
記下回應主題中 base64 編碼的 connectionId
。之後,您可以使用這個值更新或刪除連線。
若要連線至資料來源,請提供連線參數。使用連線 REST API 時,請指定 JSON 有效負載格式的連線參數。使用此表格判斷您要連線之資料來源的 JSON 有效負載。
資料來源 | 要求類型 | 輸入有效負載 |
---|---|---|
Oracle Database (非 SSL) |
應用程式/json |
基本連線類型 { "version": "2.0.0", "type": "connection", "name": "oracle_db_non_ssl_basic", "description": "Sample non-SSL Oracle Database connection created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-database", "host": "example.com", "port": "1521", "serviceName": "orcl", "username": "admin", "password": "<password>", "remoteData": false, "systemConnection": false } } } 進階連線類型 { "version": "2.0.0", "type": "connection", "name": "oracle_db_non_ssl_advanced ", "description": " Sample non-SSL Oracle Database connection created with the advanced connection string format using Connections API", "content": { "connectionParams": { "connectionString": "(DESCRIPTION= (ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON) (ADDRESS=(PROTOCOL=tcp)(HOST=example.com)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=ORCLPDB1)))", "username": "admin", "password": "<password>", "connectionType": "oracle-database", "remoteData": false, "systemConnection": false } } } |
Oracle Database (使用 SSL) |
多重部分/表單資料 |
cwallet.sso (client credentials file) 基本連線類型 cert: <cwallet.sso file location> connectionParams: { "version": "2.0.0", "type": "connection", "name": "oracle_db_ssl", "description": "Sample Oracle Database connection with SSL created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-database", "host": "example.com", "port": "2484", "serviceName": "ORCLPDB1", "username": "admin", "password": "<password>", "systemConnection": false, "remoteData": false } } } |
Oracle Autonomous Data Warehouse - 無公事包 (TLS) |
應用程式/json |
基本連線類型 { "version": "2.0.0", "type": "connection", "name": "oracle_adw_walletless_basic", "description": "Sample Oracle ADW connection without a wallet created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-autonomous-data-warehouse", "connectionString": "(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521) (host=example.com)) (connect_data=(service_name=example.com)) (security=(ssl_server_dn_match=yes)))", "username": "admin", "password": "<password>", "systemConnection": false, "remoteData": false, "sslType": "ServerSideSSL" } } } |
Oracle Autonomous Data Warehouse - 公事包 (雙向 TLS) |
多重部分/表單資料 |
cwallet.sso (client credentials file) 基本連線類型 cert: <cwallet.sso file location> connectionParams: { "version": "2.0.0", "type": "connection", "name": "oracle_adw_with_wallet", "description": "Sample Oracle ADW connection with wallet created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-autonomous-data-warehouse", "connectionString": "(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps) (port=1522)(host=example.com)) (connect_data=(service_name=example.com)) (security=(ssl_server_dn_match=yes)))", "username": "admin", "password": "<password>", "remoteData": "false", "systemConnection": false, "sslType": "ClientSideSSL" } } } |
PostgreSQL (非 SSL) |
應用程式/json |
基本連線類型 { "version":"2.0.0", "type": "connection", "name": "postgres_non_SSL", "description": "Sample PostgreSQL connection created using Connections API", "content": { "connectionParams": { "connectionType": "postgresql-database", "host": "example.com", "port": "5432", "serviceName": "postgres", "username": "admin", "password": "<password>", "remoteData": false, "systemConnection": false } } } |
PostgreSQL (使用SSL) |
應用程式/json |
基本連線類型 { "version":"2.0.0", "type": "connection", "name": "postgres_SSL_Conn", "description": "Sample PostgreSQL connection with SSL created using Connections API", "content": { "connectionParams": { "connectionType": "postgresql-database", "host": "example.com", "port": "5432", "serviceName": "postgres", "username": "admin", "password": "<password>", "sslType":"ServerSideSSL", "remoteData": false, "systemConnection": false } } } |
SQL Server (非 SSL) |
應用程式/json |
基本連線類型 { "version":"2.0.0", "type": "connection", "name": "SqlServer_non_ssl", "description": "Sample non-SSL SQL Server connection created using Connections API", "content": { "connectionParams": { "connectionType": "sqlserver-database", "host": "example.com", "port": "1400", "serviceName": "sqlserver1", "username": "admin", "password": "<password>", "remoteData": false, "systemConnection": false } } } |
SQL Server (使用 SSL) | 應用程式/json |
基本連線類型 { "version":"2.0.0", "type": "connection", "name": "SqlServer_ssl", "description": "Sample SQL Server connection with SSL created using the Connections API", "content": { "connectionParams": { "connectionType": "sqlserver-database", "host": "example.com", "port": "60190", "serviceName": "sqlserver1", "username": "admin", "password": "<password>", "sslType":"ServerSideSSL", "remoteData": false, "systemConnection": false } } } |
MySQL (非 SSL) |
應用程式/json |
基本連線類型 { "version":"2.0.0", "type": "connection", "name": "MySql_no_SSL", "description": "Sample MySQL connection created using the Connections API", "content": { "connectionParams": { "connectionType": "mysql-database", "host": "example.com", "port": "3307", "serviceName": "mysql1", "username": "admin", "password": "<password>", "remoteData": false, "systemConnection": false } } } |
MySQL (使用 SSL) | 應用程式/json |
基本連線類型 { "version":"2.0.0", "type": "connection", "name": "MySql_ssl", "description": "Sample MySQL connection with SSL created using Connections API", "content": { "connectionParams": { "connectionType": "mysql-database", "host": "example.com", "port": "3306", "serviceName": "mysql1", "username": "admin", "password": "<password>", "sslType":"ServerSideSSL", "remoteData": false, "systemConnection": false } } } |
Oracle Essbase |
應用程式/json |
基本連線類型 { "version":"2.0.0", "type": "connection", "name": "Oracle_Essbase", "description": "Sample Oracle Essbase connection created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-essbase", "dsn":"example.com", "username":"admin", "password":"<password>", "remoteData": false, "systemConnection": false, "authentication":"current"/"private"/"sso" } } } |