finding slow running queries

  • hi every one,

    I am production support DBA .application team are running queries and ssis packages.and i just want know how to find the slow running queries and slow running jobs..

    Regards
    venkat

  • You want to set up a server side trace to do that. I have a small article here on SSC[/url] describing how to do it.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • thank you for information

    i will read the article later .how can find the slow running queries.

    Regards
    venkat

  • kvr1985 (2/16/2011)


    thank you for information

    i will read the article later .how can find the slow running queries.

    Did you read the article ?



    Clear Sky SQL
    My Blog[/url]

  • kvr1985 (2/16/2011)


    thank you for information

    i will read the article later .how can find the slow running queries.

    Try reading the article that Grant helpfully linked to.

    Or, just carrying on ignoring anyone that replies. Your choice.

  • kvr1985 (2/16/2011)


    thank you for information

    i will read the article later .how can find the slow running queries.

    You can find slow running queries by using a server-side trace to gather metrics and then move those metrics into a table where you can run queries against them.

    Another option, not as effective is to use the DMO sys.dm_exec_query_stats to see what is running the slowest of the queries that are currently in cache. But this is extremely dependent on your cache, so can very easily miss long running queries that have aged out of cache.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • thank you

    Regards
    venkat

  • also, u can right click on server, reports-- standard reports

    and then see the --Top queries by average CPU time...and other more information.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • SKYBVI (2/16/2011)


    also, u can right click on server, reports-- standard reports

    and then see the --Top queries by average CPU time...and other more information.

    Regards,

    Sushant

    That uses the DMVs that Grant mentioned earlier

    Another option, not as effective is to use the DMO sys.dm_exec_query_stats to see what is running the slowest of the queries that are currently in cache. But this is extremely dependent on your cache, so can very easily miss long running queries that have aged out of cache.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • thank you guys. it's working.

    i have a one more doubt how to do server wide trace?

    Regards
    venkat

  • kvr1985 (2/16/2011)


    thank you guys. it's working.

    i have a one more doubt how to do server wide trace?

    Please read the article I posted. That's how you do a trace.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • If its working then that is what you want. You have a trace running. What more are you expecting?

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply