last time someone connected to a database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raziq Shekha

    last time someone connected to a database

    Hello all,

    Is there a way to figure out when was the last time someone connected to
    a database? SQL 2000 environment.

    Thanks,
    Raziq.



    *** Sent via Developersdex http://www.developersdex.com ***
  • Erland Sommarskog

    #2
    Re: last time someone connected to a database

    Raziq Shekha (raziq_shekha@a nadarko.com) writes:[color=blue]
    > Is there a way to figure out when was the last time someone connected to
    > a database? SQL 2000 environment.[/color]

    You would have to set up a trace with Profiler or the sp_trace_xxx routines
    to track this.


    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server SP3 at
    Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.


    Comment

    • Raziq Shekha

      #3
      Re: last time someone connected to a database

      Thanks Erland. But setting up a trace will only tell me when someone
      logs on to a database in the future. I don't think it will tell me
      whether someone logged on to a database last week.

      What I am trying to do is to determine whether there are any databases
      to which no one has connected to in a long time. And if that is the
      case, I can try and get rid of those databases.

      Thanks,
      Raziq.






      *** Sent via Developersdex http://www.developersdex.com ***

      Comment

      • Erland Sommarskog

        #4
        Re: last time someone connected to a database

        Raziq Shekha (raziq_shekha@a nadarko.com) writes:[color=blue]
        > Thanks Erland. But setting up a trace will only tell me when someone
        > logs on to a database in the future. I don't think it will tell me
        > whether someone logged on to a database last week.[/color]

        Correct. The information you are asking for, is not available unless
        you collect it.
        [color=blue]
        > What I am trying to do is to determine whether there are any databases
        > to which no one has connected to in a long time. And if that is the
        > case, I can try and get rid of those databases.[/color]

        Be aggressive! Find the most suspicious ones, set them offline, and
        see if someone screams!


        --
        Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

        Books Online for SQL Server SP3 at
        Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.


        Comment

        • Raziq Shekha

          #5
          Re: last time someone connected to a database

          LOL. I like the way you think :)

          Thanks,
          Raziq.


          *** Sent via Developersdex http://www.developersdex.com ***

          Comment

          • Raziq Shekha

            #6
            Re: last time someone connected to a database

            LOL. I like the way you think :)

            Thanks,
            Raziq.


            *** Sent via Developersdex http://www.developersdex.com ***

            Comment

            Working...