User Activity

  • Hello friends

    I am new in SQL Server.

    I have a task to monitor user activity on server or database.

    so do anyone know any query for that?

    Thanks In Advance

  • Adam Machanic wrote a great proc for this. You can read about it on his blog where he did a whole month on monitoring:

    http://sqlblog.com/blogs/adam_machanic/archive/2011/04/30/twenty-nine-days-of-activity-monitoring-a-month-of-activity-monitoring-part-30-of-30.aspx

  • You want to monitor "user activity", but what kind of activity? That is a very broad statement that needs clarification before a more specific recommendation can be made.



    Twitter: @SQLife
    Email: sqlsalt(at)outlook(dot)com

  • I need to monitor

    What user is currently working on database.

    and what they actually do

  • surma.sql (4/25/2012)


    I need to monitor

    What user is currently working on database.

    and what they actually do

    That is still a might broad statement.

  • If what you want to do is monitor SQL issued against the databases and by whom you can use SQL profiler, but run it as a server side trace

    ---------------------------------------------------------------------

  • Run the profiler as a server side trace to know all user and server activities

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • Monitoring the server generally means gathering different kinds of performance metrics. SQL Server comes with four tools that allow you to set this up on your own, Performance Monitor, Server-Side Trace, Extended Events, Dynamic Managment Objects (DMO). If you have an enterprise version available, you can use the Performance Data Collector to monitor all the other servers, but it's not very customizable. Performance Monitor is primarily for monitoring the operating system and the SQL Server service. Trace and Extended Events are good for monitoring things occurring internally like queries, errors, deadlocks, etc. The DMOs are a mixed bag, showing you some server metrics, some query metrics and other internals. Finally, for a few things, you'll need to use the old DBCC commands.

    Getting these tools set up to gather metrics is not something I'm going to try to describe in a blog post. For details, get a copy of my book on query performance tuning. I lay it all out there.

    "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

  • Great information and summary, Grant.



    Twitter: @SQLife
    Email: sqlsalt(at)outlook(dot)com

  • Thomas Stringer (4/26/2012)


    Great information and summary, Grant.

    Thanks. I've had a little practice laying out that information though, so it's not that big an accomplishment.

    "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

Viewing 10 posts - 1 through 9 (of 9 total)

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