Chris Webb's BI Blog

Analysis Services, MDX, PowerPivot, DAX and anything BI-related

Archive for January 2009

UK BI User Group meeting next week

with one comment

OK, this is rather short notice I know but the UK SQL Server User Group is hosting a BI evening event next week, on January 15th at Microsoft’s HQ in Reading:
http://sqlserverfaq.com/default.aspx?item=event&itemid=139

Since this is the rumoured date for Microsoft laying off 15% of its staff, you might be advised to wear some wellies in case you step in a puddle of blood on the floor. Hopefully all the BI folks will be ok though…

Anyway if you follow the link you’ll see that I’m one of the speakers: I’ll be repeating the session I did at PASS last year on building a monitoring solution for Integration Services, Analysis Services and Reporting Services. Also speaking will be Allan Mitchell, on his new pet hobby of data mining. Hope to see you there!

Written by Chris Webb

January 5, 2009 at 5:16 pm

Posted in Events

What hierarchies are actually being used in my cube?

with one comment

Working out how to monitor Analysis Services usage is something I’ve spent a fair bit of time doing over the last few months; I’ll get around to writing up my SQLBits presentation here soon, I promise, but in the meantime here’s a quick blog entry on a related topic: how can you work out which dimension hierarchies your users are actually using in their queries? It’s useful to know this for a number of reasons, for example if you’re thinking of changing the AggregationUsage, AttributeHierarchyEnabled or AttributeHierarchyOptimizedState properties. Or if you’re just plain curious.

The first step towards answering this question is to capture all the MDX queries that are being run, and you can do this by running a Profiler trace on the Query Begin event and saving it to a table in SQL Server in the way I described here. Once you’ve got the queries you then need to work out which queries mention which hierarchies and you can do this in SSIS using the Term Lookup transform in the data flow:

SSISHierarchies

Unfortunately the Term Lookup transform is a bit picky as far as the input it can use. You can get a list of all the hierarchies in every dimension in every database in Analysis Services by running the following DMV query:
select * from $system.mdschema_hierarchies

To be able to use this in a Term Lookup I had to create a linked server in SQL Server pointing to Analysis Services, then building a view that queried the Analysis Services DMV using the OpenQuery function so:
select cast(hierarchy_unique_name as varchar(100)) as HIERARCHY_UNIQUENAME from openquery([AS], ‘select * from $system.mdschema_hierarchies’)

Having done this, and having run the SSIS package, you then get a table containing one row for each query/hierarchy combination:
TermLookupOutput

Running a select distinct on this table of course gives you a list of all the hierarchies mentioned in your queries:
image 

Using different DMVs would allow you to analyse different aspects of the queries – for example, you could work out which MDX functions were being used in the queries with the mdschema_functions DMV (similar to what Mosha was doing here, but maybe with a view to seeing whether your client tool was using ‘bad’ MDX functions).

Written by Chris Webb

January 4, 2009 at 9:58 pm

Posted in Analysis Services

Follow

Get every new post delivered to your Inbox.

Join 2,868 other followers