Wednesday, September 2, 2015

Data Source (SSAS Multidimensional)

In an Analysis Services multidimensional model, a data source object represents a connection to the data source (Database or Data warehouse) from which you are processing (or importing (Or load)) data. A multidimensional model must contain at least one data source object, If we have the situations, where we have to use multiple databases then we use multiple data sources. In general, Most of the times we may work with 1 or 2 data sources.

Data Source in SSAS contains the connection information and it is the combination of Provider, Server Name, Database Name and Impersonation Information.


Choose a Data Provider:

SSAS Supports both Microsoft .NET Framework or native OLE DB provider. The recommended data provider for SQL Server data sources is SQL Server Native Client because it typically offers better performance. 

The default provider for a new connection is the Native OLE DB\SQL Server Native Client provider. This provider is used to connect to a SQL Server Database Engine instance using OLE DB.

Following are some of the major data sources supported by SSAS: SQL Server, MS Access, Oracle, Teradata, IBM DB2, and other relational databases with the appropriate OLE DB provider.


Server Name:


Server Name is the network name of the Database Engine instance. It can be specified as the IP address, the NETBIOS name of the computer, or a fully qualified domain name. If the server is installed as a named instance, you must include the instance name (for example, <computername>\<instancename>).

Log on to the Server specifies how the connection will be authentication. Use Windows Authentication uses Windows authentication. Use SQL Server Authentication specifies a database user login for a Windows Azure SQL databases or a SQL Server instance that supports mixed mode authentication.

Connection Manager includes a Save my password checkbox for connections that use SQL Server authentication. Although the checkbox is always visible, it is not always used.


Database Name:


Select or enter a database name or Attach a database file are used to specify the database.

In the left side of the dialog box, click All to view additional settings for this connection, including all default settings for this provider. Change settings as appropriate for your environment and then click OK.

The new connection appears in the Data Connection pane of the Select how to define the connection page of the Data Source Wizard.


Impersonation Information:

When we design a cube in which data source is using windows authentication then it will be executed as current user. But, when you deploy the database to the server there will be no current user. In this case when a user requests AS to process an object it needs to know under what security context to connect to the data source. Essentially you need to get the AS service to impersonate another user in order to retrieve data from an external source on a user’s behalf.
Impersonation allows SSAS to assume the identity/security context of the client application which is used by SSAS to perform the server side data operations like data access, processing etc. As part of impersonation, the following options are available in SSAS:
Use a specific Windows user name and password: This option lets you to specify Windows account credentials which will be used by SSAS to perform operations like source data access, processing etc.
Use the service account: When this option is selected, SSAS uses the credentials of the service account under which the Analysis Services service is configured/running for source data access, processing etc.

Use the credentials of the current user: When this option is set, SSAS uses the credentials of the current user for performing operations like DMX Open Queries, Local cubes etc. This option cannot be used for performing server side operations like source data access, processing etc.

Inherit: This option let's the SSAS server decide which impersonation mode is suitable for each type of operation. When this option is set, by default SSAS will use the service account for operations like processing and the credentials of the current user for operations like Local cubes, querying the data mining models, etc...


View or Edit Connection Properties

To edit the connection string

1. In SQL Server Data Tools, double-click the data source object in Solution Explorer.

2. Click Edit, and then click All on the left navigation pane.

3. The property grid appears, showing available properties of the data provider you are using. 


Creating Data Source in SSAS

After creating the New multidimensional project (Analysis Services project), the solution explorer looks like below

      



To create data source, Right click on the Data Sources folder present in the solution explorer and select the New Data Source option from the context menu

                



It will open the Data source wizard with the welcome page. If you don’t want to see this welcome page again check mark the option Don’t show this page again below.

              



Click Next


                


If you observe the above, Data Connections pane is empty because we have no connection managers before. If we created any connection managers before then instead of creating them again and again we can select them here.

Click on the new button from the above screenshot will open another window form of Connection Manager to select the Provider, Server Name and Database Name.

               



From the above screenshot, you can observe that we are using our localhost windows account as server name and [AdventureWorksDW2014] as the database name.

NOTE: Here we are working with local database so we are using windows credentials but in real time, you have to select the SQl Server authentication and provide the credentials given by the database admin people or your team leader.

Click on the Test Connection button provided below to check whether the connection is successful or not.

                  



Click ok

                   



Click Next to configure Impersonation settings 

Impersonation Options Available in SSAS:
             


                


Click on finish button and check the solution explorer for newly created data source

              







Create a Data Source in SSAS


In this article, I will show you how to Create a Data Source in SSAS.
Before starting this,Download AdventureWorksDW2012 database from below link:
After completion of download, attach that database into your SQL Server 2012.
1. Now open Visual Studio 2010.
2. Then go to File –>  New –> Project.
2-Create a Data Source in SSAS
3. A New Project Window opens. In that select Business Intelligence fromInstalled Templates. Then select Analysis Services Multidimensional and Data Mining Project.Also give Name of project i.e. StartSSAS.
3-Create a Data Source in SSAS
Then click on OK button.
4. Now your Project’s Solution Explorer looks like below:
4-Create a Data Source in SSAS
5. Now right click on Data Sources and Select New Data Source.
5-Create a Data Source in SSAS
6. A Data Source Wizard opens, In that select checkbox of Don’t show this page again. Then click on Next Button.
6-Create a Data Source in SSAS
7. In next step, click on New Button.
7-Create a Data Source in SSAS
8. A Connection Manager dialog-box opens. In that Enter the Server Name and provide necessary credentials. Then select AdventureWorksDW2012 Database.
8-Create a Data Source in SSAS
Then click on OK button.
9. Now you will see screen like below.
9-Create a Data Source in SSAS
Now click on Next Button.
10. In next step, Impersonation Information page appears. On this page, you can configure the Windows security credentials.
  • Use A Specific Windows User name and Password option lets you enter user name & password of a Windows user account.
  • Use The Service Account option will have Analysis Services use its service logon user ID to connect to the data source.
  • Use The Credentials Of The Current User option is only used for some specialized circumstances. It is important to note that when you use this option, Analysis Services will not use the Windows user name and password of the current user for most processing and query tasks.
  • Inherit option causes this data source to use the impersonation information contained in the Analysis ServicesDataSourceImpersonationInfo database property.
The most commonly selected options are Use the service account or Use a specific windows user name and password.
10-Create a Data Source in SSAS
Here we select Use the service Account option and then click on Next button.
11. Leave AdventureWorksDW2012 as the data source name and click Finishto complete the wizard.
11-Create a Data Source in SSAS
12. Now you will see newly created data source in your Solution Explorer.
12-Create a Data Source in SSAS
Congratulations! We successfully created Data Source in SSAS.

************************** End of the Document***********************************