Last date database activity

  • how to monitor below requirements? In sql server 2005, could anyone give me a script,

    Database name

    User name

    Last database activity

    Last login name & datetime

    Last logout datetime

    Thanks

  • I dont have a script right now but I believe it will be something look like a mixture of DMVs and/or SS2K5 - Default trace?

    -Forum Etiquette: How to post Performance Problems[/url]

    -Forum Etiquette: How to post data/code to get the best help [/url]

  • ananda.murugesan (9/15/2009)


    how to monitor below requirements? In sql server 2005, could anyone give me a script,

    Database name

    User name

    Last database activity

    Last login name & datetime

    Last logout datetime

    Thanks

    You dont say what sort of monitoring you are after, a script to run in the morning, periodic, or a light weight trace you can run during the day.

    to return the last database activity, you would need to use a trace, and define what you mean by last database activity

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • As a datacenter part, we want know who was last login the sq server 2005? and we need to execute the script once in a week. If you provide the script, ie really help for us.

  • You could use database triggers to capture the events to a table. You can capture DML events and log those with the time and login with time but I don't think you can capture logout's. You would need to use event notification or a trace

Viewing 5 posts - 1 through 4 (of 4 total)

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