locked
Identify Last long running MDX query (SSAS Tabular) by using Dynamic Views (DMV) RRS feed

  • Question

  • Hi,

    Is there any way Identify Last long running MDX query (SSAS Tabular) by using Dynamic Views (DMV). I know we can use Profiler but using profiler every time for this is not a good idea.

    Regards
    Rajaniesh

    Thursday, June 15, 2017 3:32 PM

All replies

  • either of the following can give you information on the last command for a session

    select * from $system.discover_sessions
    select * from $system.discover_commands


    http://darren.gosbell.com - please mark correct answers

    Thursday, June 15, 2017 11:26 PM
  • Hi Rajaniesh,

    Thanks for your question.

    For this issue, you may want to refer to below blogs:
    Using DMVs to Monitor and Terminate Long Running MDX Queries 

    The DMV query:

    SELECT SESSION_SPID, SESSION_USER_NAME, SESSION_LAST_COMMAND, SESSION_LAST_COMMAND_ELAPSED_TIME_MS FROM $SYSTEM.DISCOVER_SESSIONS ORDER BY SESSION_LAST_COMMAND_ELAPSED_TIME_MS DESC


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Friday, June 16, 2017 4:37 AM