Thursday, February 6, 2014

Build, Deploy and Process of SSAS cube

This blog is all about Build, Deploy and Process of SSAS cube.


Firstly, when we build the cube, the build process will create four XML files inside the bin folder. As the names hint at, the asdatabase file is the main object definition file and the three other files contain configuration and deployment metadata.




Secondly, the deployment process will attach the above files to running Server Analysis Service. This deployment can be done by many ways, but more appropriate option for production deployment is deploy by Deployment Wizard Tool, because this tool will allow doing many configuration settings.


The following screenshots show the steps of deployment via Deployment Wizard Tool.







If necessary we can create script as well. This will create XMLA file, which contains all the configurations and related data. The XMLA is stand for “XML for Analysis” open standard supports data access to data source that reside on the World Wide Web. Microsoft SQL Server Analysis Services implements XMLA per the XMLA 1.1 specification. XMLA is a Simple Object Access protocol (SOAP) – based XML protocol, designed for universal data access to any standard multidimensional data source residing on the web.



Finally, the Processing is the step, or series of steps, in which Analysis Service loads data from a relational data source into a multidimensional model. For objects that use MOLAP storage, data is saved on disk in the database file folder. For ROLAP storage, processing occur on demand, in response to MDX query on an object. For object that uses ROLAP storage, processing refers to updating the cache before returning query results.


Processing Objects: Processing affects the following Analysis Service objects: measure groups, partitions, dimensions, cubes, mining models, mining structure, and databases. When an object contains one or more objects, processing the highest-level object causes a cascade of processing all the lower-level objects. For example, a cube typically contains measure groups (each of which contains one or more partitions) and dimensions.  Processing a cube causes processing of all the measure groups within the cube and the constituent dimensions that are currently in an unprocessed state.

While the processing job is working, the affected Analysis Service Objects can be accessed for querying. The processing job works inside a transaction and the transaction can be committed, or rolled back. If the processing job fails, the transaction is rolled back. If the processing job succeeds, an exclusive lock is put on the object when changes are being committed, which means the object is temporarily unavailable for querying or processing. During the committed phase of the transaction, queries can still be sent to the object, but they will be queued until the commit is completed.
Processing stage can be check using the object properties, the below image show the Cube processing stage.





Likewise we can check object wise processing stage. For some object if properties option is not available, then we can use the report for this.






When you process objects in Analysis Services, you can select a processing option, or you can enable Analysis Services to determine the appropriate type of processing. The processing methods made available differ from one object to another, and are based on the type of object. Additionally, the methods are based on what changes have occurred to the object since it was last processed. If you enable Analysis Service to automatically select a process method (Default), it will use the method that returns the object to a fully processed stage in the least time.


Processing Mode: The following table describes the processing methods that are available in Analysis Services, and identifies the objects for which each method is supported.
Mode
Applies to
Description
Process Default
Cubes, databases, dimensions, measure groups, mining models, mining structures, and partitions.
Detects the process state of database objects, and performs processing necessary to deliver unprocessed or partially processed objects to a fully processed state. If you change a data binding, Process Default will do a Process Full on the affected object.
Process Full
Cubes, databases, dimensions, measure groups, mining models, mining structures, and partitions.
Processes an Analysis Services object and all the objects that it contains. When Process Full is executed against an object that has already been processed, Analysis Services drops all data in the object, and then processes the object. This kind of processing is required when a structural change has been made to an object, for example, when an attribute hierarchy is added, deleted, or renamed.
Process Clear
Cubes, databases, dimensions, measure groups, mining models, mining structures, and partitions.
Drops the data in the object specified and any lower-level constituent objects. After the data is dropped, it is not reloaded.
Process Data
Dimensions, cubes, measure groups, and partitions.
Processes data only without building aggregations or indexes. If there is data is in the partitions, it will be dropped before re-populating the partition with source data.
Process Add
Dimensions, measure groups, and partitions
For dimensions, adds new members and updates dimension attribute captions and descriptions.
For measure groups and partitions, adds newly available fact data and process only to the relevant partitions.
Process Update
Dimensions
Forces a re-read of data and an update of dimension attributes. Flexible aggregations and indexes on related partitions will be dropped.
Process Index
Cubes, dimensions, measure groups, and partitions
Creates or rebuilds indexes and aggregations for all processed partitions. For unprocessed objects, this option generates an error.
Processing with this option is needed if you turn off Lazy Processing.
Process Structure
Cubes and mining structures
If the cube is unprocessed, Analysis Services will process, if it is necessary, all the cube's dimensions. After that, Analysis Services will create only cube definitions. If this option is applied to a mining structure, it populates the mining structure with source data. The difference between this option and the Process Full option is that this option does not iterate the processing down to the mining models themselves.
Process Clear Structure
Mining structures
Removes all training data from a mining structure.
Processing Settings : The following table describes the processing settings that are available for use when you create a process operation.

Processing Option
Description
Parallel
Used for batch processing. This setting causes Analysis Services to fork off processing tasks to run in parallel inside a single transaction. If there is a failure, the result is a roll-back of all changes. You can set the maximum number of parallel tasks explicitly, or let the server decide the optimal distribution. The Parallel option is useful for speeding up processing.
Sequential (Transaction Mode)
Controls the execution behavior of the processing job. Two options are available:
· One Transaction. The processing job runs as a transaction. If all processes inside the processing job succeed, all changes by the processing job are committed. If one process fails, all changes by the processing job are rolled back. One Transaction is the default value.
· Separate Transactions. Each process in the processing job runs as a stand-alone job. If one process fails, only that process is rolled back and the processing job continues. Each job commits all process changes at the end of the job.
When you process using One Transaction, all changes are committed after the processing job succeeds. This means that all Analysis Services objects affected by a particular processing job remain available for queries until the commit process. This makes the objects temporarily unavailable. Using Separate Transactionscauses all objects that are affected by a process in processing job to be taken unavailable for queries as soon as that process succeeds.
Writeback Table Option
Controls how writeback tables are handled during processing. This option applies to writeback partitions in a cube, and uses the following options:
· Use Existing. Uses the existing writeback table. This is default value.
· Create. Creates a new writeback table and causes the process to fail if one already exists.
· Create Always. Creates a new writeback table even if one already exists. An existing table is deleted and replaced.
Process Affected Objects
Controls the object scope of the processing job. An affected object is defined by object dependency. For example, partitions are dependent on the dimensions that determine aggregation, but dimensions are not dependent on partitions. You can use the following options:
· False. The job processes the objects explicitly named in the job and all dependent objects. For example, if the processing job contains only dimensions, Analysis Services processes just those objects explicitly identified in the job. If the processing job contains partitions, partition processing automatically invokes processing of affected dimensions. False is the default setting.
· True. The job processes the objects explicitly named in the job, all dependent objects, and all objects affected by the objects being processed without changing the state of the affected objects. For example, if the processing job contains only dimensions, Analysis Services also processes all partitions affected by the dimension processing for partitions that are currently in a processed state. Affected partitions that are currently in an unprocessed state are not processed. However, because partitions are dependent on dimensions, if the processing job contains only partitions, partition processing automatically invokes processing of affected dimensions, even when the dimension is currently in an unprocessed state.
Dimension Key Errors
Determines the action taken by Analysis Services when errors occur during processing. When you select Use custom error configuration, you can select values for the following actions to control error-handling behavior:
· Key error action. If a key value does not yet exist in a record, one of these actions is selected to occur:
o  Convert to unknown. The key is interpreted as an unknown member. This is the default setting.
o  Discard record. The record is discarded.
· Processing error limit. Controls the number of errors processed by selecting one of these options:
o  Ignore errors count. This will enable processing to continue regardless of the number of errors.
o  Stop on error. With this option, you control two additional settings. Number of errors lets you limit processing to the occurrence of a specific number of errors. On error action lets you determine the action when Number of errors is reached. You can select Stop processing, which causes the processing job to fail and roll back any changes, or Stop logging, which enables processing to continue without logging errors. Stop on erroris the default setting with Number of errors set to 0 and On error action set to Stop processing.
· Specific error conditions. You can set the following options to control specific error-handling behavior:
o  Key not found. Occurs when a key value exists in a partition but does not exist in the corresponding dimension. The default setting is Report and continue. Other settings are Ignore error and Report and stop.
o  Duplicate key. Occurs when more than one key value exists in a dimension. The default setting is Ignore error. Other settings are Report and continue and Report and stop.
o  Null key converted to unknown. Occurs when a key value is null and the Key error action is set to Convert to unknown. The default setting isIgnore error. Other settings are Report and continue and Report and stop.
o  Null key not allowed. Occurs when Key error action is set to Discard record. The default setting is Report and continue. Other settings areIgnore error and Report and stop.
When you select Use default error configuration, Analysis Services uses the error configuration that is set for each object being processed. If an object is set to use default configuration settings, Analysis Services uses the default settings that are listed for each option.
Cheers!

Friday, January 10, 2014

Non-SysAdmins have been denied permission to run DTS Execution job steps without a proxy account

When I tried to run the integration package through SQL Server Agent Job in the client environment, it failed with error message "Non-SysAdmins have been denied permission to run DTS Execution job steps without a proxy account.". However, while run the package from Integration Service, it ran successfully.  As we can’t request “sysadmin” permission from client’s for production environment, there should be alternative way to solve this problem.


The error message is clearly telling the solution to this problem that is create a proxy account and run the job by that proxy account, so I did the same the problem was solved. As this proxy account was new to me, I am writing this blog about what is proxy account? And How to create it? Some more details about it.
What is SQL Server proxy account?

A SQL Server proxy account defines a security context in which a job step can run. Each proxy corresponds to a security credential. To set permissions for a particular job step, create a proxy that has the required permissions for a SQL Server Agent subsystem, and then assign that proxy to the job step. To get further information in technet site such Limitations and Restrictions and Security.
You must create a credential before you create a proxy if one is not already available. The below images show that steps that to create credential for my windows user account.



Once you click on New Credential this will pop up the below screen, give any name for the credential and select the existing user, any password and then press ok. This will create the credential as shown below.






Once you create the credential, create a new proxy account under SQL Server Agent as shown below.


In the New Proxy Account Window, give proxy account name as you want, select the credential and select the relevant activity that need to perform by this proxy account.





Here I have selected 3 activities that are why the proxy account will be under the activity subfolders.





Once you create done this, while creating the Job step, just select the particular proxy account for “Run as”.





Cheers!
Uma




Tuesday, December 17, 2013

Logon failure: unknown user name or bad password - SSAS 2012

Error Message
Internal error: The operation terminated unsuccessfully.
The following system error occurred:  Logon failure: unknown user name or bad password.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Adventure Works DW2012', Name of 'Adventure Works DW2012'.


Description
This error occurred when process a cube, this is happening while process only, the cube can be deployed successfully. There can be many reasons why “a connection could not be made to the data source”, but the connection parameter all varied and all fine. This issue was happened in SQL Server 2012 environment.


Solution
Reason was Set Impersonation Options not set.
When creating a data source object in an Analysis Service model, one of the settings that you must configure is an impersonation option. This option determines whether Analysis Service assumes the identity of a specific Windows user account when performing operational related to connection, such loading an OLE DB data provider or resolving user profile information in environments that support roaming profiles.


Set impersonation options in SQL Server Data Tools
  1. Double-click a data source in Solution Explorer to open Data Source Designer.
  2. Click the Impersonation Information tab in Data Source Designer.
  3. Choose an option described in Impersonation options in this topic.
Set impersonation options in Management Studio
In Management Studio, open the Impersonation Information dialog box by clicking the ellipsis (...) button for the following properties of these dialog boxes:
  1. Database Properties dialog box, through the Data Source Impersonation Info property.
  2. Data Source Properties dialog box, through the Impersonation Info property.
  3. Assembly Properties dialog box, through the Impersonation Info property.



Cheers!

Thursday, December 5, 2013

How to round a MDX value

In most of the case, you may want to perform a round operation. The one of the following ways can use for this.





Cheers!



Tuesday, December 3, 2013

MDX query to retrieve Dimension member properties (Unique_Name and MEMBER_KEY)

Analysis Services exposes intrinsic properties on dimension members that you can include in a query to return additional data or metadata for use in a custom application, or to assist in model investigations or construction. In here I am going to explain how to retrieve the properties through the SQL Server Management Studio (SSMS) and MDX.

In below simple MDX query retrieve all the members of Employee Hierarchy, when double click on any the member, Member Properties window will pop up. In this window some of the member properties will be display as shown below.


If we want to retire all the member properties, properties need to include in the MDX query.




To get through the MDX query, the following query format can be used.





Cheers!

Sunday, December 1, 2013

How to: Create an Analysis Services Project Based on an Existing Analysis Services Database

In SQL Server Data Tools (SSDT), click New Project. In the New Project dialog box, in the Installed Template pane, select Business Intelligence Projects, and then select Analysis Services.
Select “Import from Server” and follow the steps as show in the below screen shots.


Select SSA Server and Database, then click next, new project will be created with existing objects in the SSAS Database.





Cheers!