Written by Rob Risetto
Analysis Services Diagnostics
Analysis Services diagnostics can be a real pain at times, trying to understand why processing is not advancing or why a cube query is not coming back in a timely manner. Here’s some of the get out of jail diagnostics queries for SSAS that I gleamed from respected SSAS gurus.
Ever encountered a GB+ sized SSAS log file, well this Powershell command provides a quick way to check the tail of the log.
I’m showing the last 500 lines
Enter Powershell prompt, then runget-content <yourpath>\OLAP\Log\msmdsrv.log -tail 500
Got some locking going on? Connect to SSAS via SSMS and run the following query.
select * from $system.discover_locks
You may need to know the commands and sessions also
select * from $system.discover_sessions
select * from $system.discover_connections
select * from $system.discover_commands
The below query combines some of the internal views for a more convenient check and allows you to run from a standard Query Window connected to a SQL Server Engine.
Create a linked server on a SQL Server, replace the linked server name in the definition and then run the below query to create the linked server.EXEC master.dbo.sp_addlinkedserver @server = N'SSASCheck', @srvproduct='MSOLAP', @provider=N'MSOLAP',
@datasrc=N'<Your SSAS server name
>'
Then run the Openquery statement below to combine data from some of the relevant SSAS internal views.
SELECT ssasSessions.SESSION_SPID AS [SPID],
ssasSessions.SESSION_USER_NAME AS [User ID],
ssasSessions.SESSION_CURRENT_DATABASE AS [Database],
ssasConnections.connection_host_name AS ‘Client IP address’,
ROUND(CAST(ssasCommands.COMMAND_CPU_TIME_MS AS int)/1000, 2) AS [Command Time(in sec)],
ssasCommands.COMMAND_START_TIME AS [Command Start Time],
ssasCommands.COMMAND_END_TIME AS [Command End Time],
ssasCommands.COMMAND_TEXT AS [MDX Command],
connection_host_application AS ‘Application’,
CHARINDEX(”,ssasCommands.COMMAND_TEXT) AS ProcessRunning
FROM OPENQUERY( SSASCheck ,’select * from $system.discover_sessions’) AS ssasSessions
LEFT JOIN OPENQUERY(SSASCheck,’select * from $system.discover_commands’) AS ssasCommands ON ssasSessions.SESSION_SPID = ssasCommands.SESSION_SPID
LEFT JOIN OPENQUERY( SSASCheck ,’select * from $system.discover_connections’) AS ssasConnections ON ssasSessions.SESSION_connection_id = ssasConnections.connection_id
ORDER BY [Command Start Time] DESC