今すぐお試しください!

製品の詳細CData ODBC Driver for SQL Analysis Services を確認して、無償評価版をダウンロード:

今すぐダウンロード

PolyBase で外部データソースとしてSQL Analysis Services を連携利用

CData ODBC Driver for SQL Analysis Services とSQL Server 2019 のPolyBase を使って、リアルタイムSQL Analysis Services data に外部データソースとしてアクセス。

SQL Server のPolyBase は、データベーステーブルをクエリするTransact-SQL シンタックスを使って、外部データにクエリする仕組みです。 CData ODBC Drivers for SQL Analysis Services data を組み合わせて使うことで、SQL Server データと同じようにSQL Analysis Services data へのアクセスが可能です。 本記事では、PolyBase 外部データソースへのSQL Analysis Services data の設定から、T-SQL クエリを使ったSQL Analysis Services data へのアクセスを行います。

The CData ODBC drivers offer unmatched performance for interacting with live SQL Analysis Services data using PolyBase due to optimized data processing built into the driver. When you issue complex SQL queries from SQL Server to SQL Analysis Services, the driver pushes down supported SQL operations, like filters and aggregations, directly to SQL Analysis Services and utilizes the embedded SQL engine to process unsupported operations (often SQL functions and JOIN operations) client-side. And with PolyBase, you can also join SQL Server data with SQL Analysis Services data, using a single query to pull data from distributed sources.

SQL Analysis Services への接続

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs. To create an external data source in SQL Server using PolyBase, configure a System DSN (CData SQL Analysis Services Sys is created automatically).

接続するには、Url プロパティを有効なSQL Server Analysis Services エンドポイントに設定して認証を提供します。XMLA アクセスを使用して、HTTP 経由でホストされているSQL Server Analysis Services インスタンスに接続できます。 Microsoft ドキュメント configure HTTP access tを参照してSQL Server Analysis Services に接続してください。

SQL をSQL Server Analysis Services に実行するには、Analysis Services データの取得 を参照してください。接続ごとにメタデータを取得する代わりに、CacheLocation を設定できます。

  • HTTP 認証

    AuthScheme を"Basic" または"Digest" に設定してUser とPassword を設定します。CustomHeaders に他の認証値を指定します。

  • Windows (NTLM)

    Windows のUser とPassword を設定して、AuthScheme をNTLM に設定します。

  • Kerberos およびKerberos Delegation

    Kerberos を認証するには、AuthScheme をNEGOTIATE に設定します。Kerberos 委任を使うには、AuthScheme をKERBEROSDELEGATION に設定します。必要があれば、User、Password およびKerberosSPN を設定します。デフォルトでは、本製品 は指定されたUrl でSPN と通信しようと試みます。

  • SSL/TLS:

    デフォルトでは、本製品 はサーバーの証明書をシステムの信頼できる証明書ストアと照合してSSL/TLS のネゴシエーションを試みます。別の証明書を指定するには、利用可能なフォーマットについてSSLServerCert プロパティを参照してください。

You can then access any cube as a relational table: When you connect the data provider retrieves SSAS metadata and dynamically updates the table schemas. Instead of retrieving metadata every connection, you can set the CacheLocation property to automatically cache to a simple file-based store.

See the Getting Started section of the CData documentation, under Retrieving Analysis Services Data, to execute SQL-92 queries to the cubes.

Click "Test Connection" to ensure that the DSN is connected to SQL Analysis Services properly. Navigate to the Tables tab to review the table definitions for SQL Analysis Services.

SQL Analysis Services Data の外部データソースの作成

After configuring the connection, you need to create a master encryption key and a credential database for the external data source.

Creating a Master Encryption Key

Execute the following SQL command to create a new master key, 'ENCRYPTION,' to encrypt the credentials for the external data source.

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'password';

Creating a Credential Database

Execute the following SQL command to create credentials for the external data source connected to SQL Analysis Services data.

NOTE: IDENTITY and SECRET correspond with the User and Password properties for SQL Analysis Services.

CREATE DATABASE SCOPED CREDENTIAL ssas_creds
WITH IDENTITY = 'username', SECRET = 'password';

Create an External Data Source for SQL Analysis Services

Execute the following SQL command to create an external data source for SQL Analysis Services with PolyBase, using the DSN and credentials configured earlier.

For SQL Analysis Services, set SERVERNAME to 'localhost' or '127.0.0.1' and leave PORT empty. PUSHDOWN is set to ON by default, meaning the ODBC Driver can leverage server-side processing for complex queries.

CREATE EXTERNAL DATA SOURCE cdata_ssas_source
WITH ( 
  LOCATION = 'odbc://SERVERNAME[:PORT]',
  CONNECTION_OPTIONS = 'DSN=CData SQL Analysis Services Sys',
  -- PUSHDOWN = ON | OFF,
  CREDENTIAL = ssas_creds
);

SQL Analysis Services のExternal Table を作成

After creating the external data source, use CREATE EXTERNAL TABLE statements to link to SQL Analysis Services data from your SQL Server instance. The table column definitions must match those exposed by the CData ODBC Driver for SQL Analysis Services. You can refer to the Tables tab of the DSN Configuration Wizard to see the table definition.

Sample CREATE TABLE Statement

The statement to create an external table based on a SQL Analysis Services Adventure_Works would look similar to the following:

CREATE EXTERNAL TABLE Adventure_Works(
  Fiscal_Year [nvarchar](255) NULL,
  Sales_Amount [nvarchar](255) NULL,
  ...
) WITH ( 
  LOCATION='Adventure_Works',
  DATA_SOURCE=cdata_ssas_source
);

Having created external tables for SQL Analysis Services in your SQL Server instance, you are now able to query local and remote data simultaneously. Thanks to built-in query processing in the CData ODBC Driver, you know that as much query processing as possible is being pushed to SQL Analysis Services, freeing up local resources and computing power. Download a free, 30-day trial of the ODBC Driver for SQL Analysis Services and start working with live SQL Analysis Services data alongside your SQL Server data today.

 
 
ダウンロード