Real Time ROLAP Setup in SSAS Enterprise Edition

If you need to access the underlying data in an SSAS measure group in Real Time with no latency (without any processing involved), proactive caching setting Real Time ROLAP has to be configured.  If you work on a typical Datawarehouse, this need is not normal. But if you use SSAS for real time calculations this setup will be useful.

Procedure:

1) Select the Storage Settings of the partition to be configured and select Real Time ROLAP.

RealTimeRolap

2) Click on Options to launch the Storage Options window as below .

StorageOptionsRTR

Note that the Latency is mentioned as 0 (zero). 

3) Go to the Notifications tab and select SQL Server (if the fact table resides in SQL Server)

You can select more than one tracking tables to watch for any updates. When the measure group is deployed SSAS watches for trace events raised against the specific tables. To do this, SSAS needs ALTER TRACE privileges in the underlying database (as mentioned in the bottom of the dialog box below)

SpecifyTrackingTablesRTR

Posted in MDX, Proactive Caching, ROLAP, SSAS | Tagged , | Leave a comment

How to check for Contiguous Dates

Let’s say we have an SCD 2 Dimension called Dimension.Store.  Lets assume the Business Key is BranchCode and the type II rows is versioned using RowStartDate & RowEndDate  columns.

How do we verify if the dates are contiguous with no gaps between different Type II Versions?

1) FromDate is not duplicated within the same Business Key

IF EXISTS
(SELECT BranchCode, [RowStartDate], COUNT(*)
FROM Dimension.Store
GROUP BY BranchCode, [RowStartDate]
HAVING COUNT(*) > 1)
SELECT ‘Error::Duplicate From Date Found for the same Branch’

2) FromDate should not be earlier than ToDate

IF EXISTS
(SELECT 1 FROM Dimension.Store WHERE RowStartDate > RowEndDate
)
SELECT ‘Error::To Date is Earlier Than From Date’

3) There should be no gaps Between EndDate of the previous Row and StartDate of the next row

SELECT BranchCode,
CASE WHEN DATEDIFF(DAY, MIN(RowStartDate),MAX(RowEndDate)) + 1 <> SUM(DATEDIFF(D, RowStartDate,RowEndDate) + 1) THEN ‘Bad::GapsInDateColumns’ ELSE ‘Good::NoGapsFoundInDateColumns’ END AS ErrorStatus
FROM Dimension.Store
GROUP BY BranchCode

Posted in Data Quality, DataWareHousing, Uncategorized | Leave a comment

Chart Design Guidelines

I have been reading about Information Design recently. After having looked at a few charts which provide no useful data / misleading data, I searched if there are any set of standard guidelines for this.

HICHERT+PARTNER is a company specialising in this area and they have a set of guidelines for Information Design. They call these guidelines – SUCCESS

S – Say
U – Unify
C – Condense
C – Check
E – Enable
S – Simply
S – Structure

This looks interesting !

http://www.hichert.com/en/success

Posted in Chart, Presentation | Leave a comment

MDX Studio – Tool to Debug MDX

MDX Studio is a great tool developed by Mosha to help in tuning and debugging MDX. This is a Windows application which one can install in a PC / Windows Server.

There is a cut-down version of the tool online as well.

Some of the Features:

a) MDX Execution related Performance monitor values such as Storage Engine (SE) Queries, Memory Usage, Cache hits etc

b) Suggest Best Practice MDX after analysing the MDX

c) MDX visualisation using a Trace Tree

There is a detailed talk done by Ashwani Roy, in the URL below.  There is a slide deck and a video you can download from here.

http://sqlbits.com/Sessions/Event6/Supercharge_MDX_performance_using_MDX_Studio

Regards

Jegan

 

Posted in MDX, SSAS | Leave a comment

SSAS Data Connection and Impersonation Info

When we create a datasource in SSAS, we need two types of connection information

Data Connection:

As the name goes, this information is used to connect to data source. This can be a standard User ID / Password combination (can be used for SQL Server, Oracle or any DB). If you connect to SQL Server, you can use Windows Authentication also (preferred method due to better security) for this.

Impersonation Information:

This specifies a Windows account used for SSAS Server management such as cube processing (create aggregations, SSAS indexes and write those into SSAS internal files such as *.lstore, *.asstore found in D:\Program Files\Microsoft SQL Server\MSAS10.SQL2008\OLAP\Data\<ProjectName>\ ). This cannot be a SQL account since OS tasks need to be achieved using this authentication.

Regards

Jegan

Posted in BusinessIntelligence, SSAS | Tagged | Leave a comment

Open Source Web Pivot Table Control – CellSetGrid Download

Recently We were working on an SSAS Cube which needed direct end user web access using Pivot Table like functionality. We used CellSetGrid – an open Source ASP .Net Web Control. I have downloaded this control some time ago from www.SQLServerAnalysisServices.Com. This was developed by MS folks and hosted in the site.

When I checked if there is any new release of this control, I realized the source code is not hosted anymore in this site.This is because the domain name is acquired by another company to promote their products :(.

So I have uploaded the source of the control CellSetGrid here.

http://www.box.net/shared/6gi0n79q6t

-Jegan

Posted in Pivot Table, PivotTable | Leave a comment

SSIS ETL Framework

 

In my current job, we have a custom ETL framework to control the execution of SSIS packages.

Some of the features of our ETL framework is as follows:

a) Control the execution of packages using metadata tables

We use a manager package to call other packages which in turn call other packages as shown below.

ManagerPackage (Level 1)

ExtractManager (Level 2)

ExtractOne (Level 3)

ExtractTwo (Level 3)

DataLoadManager (Level 2)

TransformAndLoadOne (Level 3)

TransformAndLoadTwo (Level 3)

If we want to run a snapshot every day, week or month – we can set the frequency and the snapshot packages would run based on the settings.

b) Detailed logging of the execution times and success or failure status.

c) Rerun a component if it failed in the previous run

d) Ability to rerun Data Load for Snapshot tables using control tables

e) Audit information detailing how many records are loaded in every LoadRun.

When I googled to see if there are any free / open source frameworks available I found this.

http://ssisetlframework.codeplex.com/

This provides metadata tables, SSIS Packages (Manager and sample child packages), SSRS Reports to measure performance of the package execution.

– Jegan

Posted in BusinessIntelligence, DataWareHousing, SSIS | Leave a comment

SSRS Subscriptions – Internals

This URL talks about the internals of SSRS Subscriptions.For someone to wants to debug data driven subscriptions, this would be a great help.

http://blogs.msdn.com/b/deanka/archive/2009/01/13/diagnosing-and-troubleshooting-subscriptions.aspx

-Jegan

Posted in DataFeeds, SSRS | Leave a comment

Microsoft.ReportingServices.Diagnostics.Utilities.UnknownUserNameException: The user or group name is not recognized.

Problem:

Recently our Data Driven Subscriptions started failing with the following error message (as in SSRS Error Logs found in Program Files\Microsoft SQL Server\MSRS10.SqlServer\Logfiles\….).

library!WindowsService_0!960!01/07/2011-14:17:59:: e ERROR: Error processing data driven subscription: Microsoft.ReportingServices.Diagnostics.Utilities.UnknownUserNameException: The user or group name ‘<UserName>’  is not recognized at Microsoft.ReportingServices.Library.Native.NameToSid(String name) at Microsoft.ReportingServices.Library.ActiveSubscription.CreateDataDrivenNotification(SubscriptionImpl subscription, Guid activationID, Settings settings, ParamValues paramValues) at Microsoft.ReportingServices.Library.DataDrivenSubscriptionHandler.DataDrivenSubscriptionWorker(Object o)

<UserName> mentioned above was the username of one employee who recently left our organization.

Diagnosis:

I had no idea what was going on and the first task was to identify which assembly contained this class – Microsoft.ReportingServices.Library.ActiveSubscription. After loading few assemblies from ReportServer bin folder (<Drive>:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin)  to see which assembly contained these classes, the assembly containing the calls was – ReportingServicesServer.dll. This assembly is used by the SSRS Windows Service (ReportingServices.exe) during subscription delivery.

Next step is to generate the code of this assembly and see what is happening within these method calls. I have used Reflector and File Disassembler (Reflector AddIn) to generate the code of this assembly and the code which causes the problems is as below:

public void CreateDataDrivenNotification(SubscriptionImpl subscription, Guid activationID, Settings settings, ParamValues paramValues)

{

using (InstrumentedSqlCommand command = base.NewStandardSqlCommand(“CreateDataDrivenNotification”))

{

command.Parameters.AddWithValue(“@SubscriptionID”, subscription.ID);                           command.Parameters.AddWithValue(“@ActiveationID”, activationID);                                  command.Parameters.AddWithValue(“@ReportID”, subscription.ReportID);                        command.AddParameter(“@Locale”, SqlDbType.NVarChar,        subscription.m_subscriptionCulture);                  command.AddParameter(“@ExtensionSettings”, SqlDbType.NText,                             ParameterValueOrFieldReference.ThisArrayToXml(settings.ToSoapParameterValueArray()));                command.AddParameter(“@Parameters”, SqlDbType.NText, paramValues.ToXml(false));                command.Parameters.AddWithValue(“@LastRunTime”, subscription.m_lastRunTime);                command.AddParameter(“@DeliveryExtension”, SqlDbType.NVarChar, subscription.DeliveryExtension);                command.Parameters.AddWithValue(“@OwnerSid”, Microsoft.ReportingServices.Library.Global.NameToSid(subscription.Owner)).SqlDbType = SqlDbType.VarBinary;                command.AddParameter(“@OwnerName”, SqlDbType.NVarChar, subscription.Owner.UserName);                command.Parameters.AddWithValue(“@OwnerAuthType”, (int) subscription.Owner.AuthenticationType);                command.Parameters.AddWithValue(“@Version”, subscription.m_version);                command.ExecuteNonQuery();            }        }

In this code there is a call to a method, NameToSid which tries to get Security Identifier of a User Name, which owns the Subscription. In this case, since the employee left the company, his user id was deleted. Since the User ID is not there anymore, an exception is thrown.

Fix:

Subscription related data is stored in ReportServer.dbo.Subscription table.This UserId is set as owner of the subscription in ReportServer.dbo.Subscriptions Owner_ID column  (Refers to ReportServer.dbo.Users.UserID). Now the solution is to update the OwnerId field in Subscriptions table to another user [presumably a service account or the username of a person who will never leave the company ;-)].

In this case we chose the latter. We used the following SQL to update the subscription ownership is below:

UPDATE ReportServer.dbo.Subscriptions SET OwnerID = (SELECT UserID FROM  ReportServer.dbo.Users WHERE UserName ='<Service Account UserName>’)  WHERE OwnerID = (SELECT UserID FROM ReportServer.dbo.Users WHERE UserName = ‘<Deleted UserName>’)

Since our automated deployment (to deploy subscriptions) was done using the credentials of this user, his userid was set as Subscription owner.

Googling for Change SSRS Subscription owner, brings this URL..

http://blogs.msdn.com/b/miah/archive/2008/07/10/tip-change-the-owner-of-report-server-subscription.aspx

Hmmm. If at all I knew what the problem was in the first place …:(

Posted in SSRS | Leave a comment

SSRS Data Driven Subscriptions – Queueing Mechanism

When thousands of data driven subscriptions are fired in SSRS, they are stored in ReportServer.dbo.Notifications table. Based on the workload of SSRS Service, subscriptions are picked from this table for processing.

This means even if SSRS Server / Windows Service is restarted, any data driven subscriptions initiated (but not actively running) would still be delivered. SSRS Subscription mechanism seems to be robust enough to send (in our case it is SFTP) many thousands of subscriptions without any problem.

That’s pretty good !

Posted in SSRS | Leave a comment