Friday, March 9, 2012

Is there any way to know any user Connect / Disconnect from the SQL Server?

Hi All,
Is there any way to know any user Connect / Disconnect from the SQL Server?
Such as: In any kind of "Method" OR "Event Log"
--
Thanks !Please do not crosspost.
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"SOHO" <hkwin2000@.hotmail.com> schrieb im Newsbeitrag
news:u2Grt$lcFHA.3184@.TK2MSFTNGP15.phx.gbl...
> Hi All,
> Is there any way to know any user Connect / Disconnect from the SQL
> Server?
> Such as: In any kind of "Method" OR "Event Log"
>
> --
> Thanks !
>
>|||You can switch on the logging for valid / invalid /all logons for the
registry. Its located under the properties of the Server in the EM, Tab
Security.
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"SOHO" <hkwin2000@.hotmail.com> schrieb im Newsbeitrag
news:u2Grt$lcFHA.3184@.TK2MSFTNGP15.phx.gbl...
> Hi All,
> Is there any way to know any user Connect / Disconnect from the SQL
> Server?
> Such as: In any kind of "Method" OR "Event Log"
>
> --
> Thanks !
>
>|||sorry!
--
Thanks !
"Jens Süßmeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> ¼¶¼g©ó¶l¥ó·s»D:OoNXjDmcFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Please do not crosspost.
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "SOHO" <hkwin2000@.hotmail.com> schrieb im Newsbeitrag
> news:u2Grt$lcFHA.3184@.TK2MSFTNGP15.phx.gbl...
>> Hi All,
>> Is there any way to know any user Connect / Disconnect from the SQL
>> Server?
>> Such as: In any kind of "Method" OR "Event Log"
>>
>> --
>> Thanks !
>>
>|||This is a multi-part message in MIME format.
--070603060003080705000406
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
From SQL Enterprise manager you can enable logging for all logins (both
failed & successful) in the Server Properties dialog box (Security tab,
Security group box, Audit level radio button group). This will cause
SQL Server to write messages to the SQL errorlog every time a user
connects to the SQL server (whether it's a successful or failed login
attempt). But that won't tell you anything about logouts (i.e.
disconnects).
Probably the best way to monitor this stuff is with SQL Profiler. You
can enable the 'Security Audit|Audit Login', 'Security Audit|Audit Login
Failed' & 'Security Audit|Audit Logout' events. You can get profiler to
write its trace data to a file or a SQL table so that you can query
against that data at a later time.
That would be about as close to an "event log" containing both logout &
login information that you can get your hands on. There's no way,
without altering the SQL Server binaries, to hook into the login/logout
event of a SQL server.
BTW, you ought to try to restrict your post to one or, at most, two
newsgroups.
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
SOHO wrote:
>Hi All,
>Is there any way to know any user Connect / Disconnect from the SQL Server?
>Such as: In any kind of "Method" OR "Event Log"
>
>
--070603060003080705000406
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>From SQL Enterprise manager you can enable logging for all logins
(both failed & successful) in the Server Properties dialog box
(Security tab, Security group box, Audit level radio button group).
This will cause SQL Server to write messages to the SQL errorlog every
time a user connects to the SQL server (whether it's a successful or
failed login attempt). But that won't tell you anything about logouts
(i.e. disconnects).<br>
<br>
Probably the best way to monitor this stuff is with SQL Profiler. You
can enable the 'Security Audit|Audit Login', '</tt><tt>Security Audit|</tt><tt>Audit
Login Failed' & '</tt><tt>Security Audit|</tt><tt>Audit Logout'
events. You can get profiler to write its trace data to a file or a
SQL table so that you can query against that data at a later time.<br>
<br>
That would be about as close to an "event log" containing both logout
& login information that you can get your hands on. There's no
way, without altering the SQL Server binaries, to hook into the
login/logout event of a SQL server.<br>
<br>
BTW, you ought to try to restrict your post to one or, at most, two
newsgroups.<br>
</tt>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
SOHO wrote:
<blockquote cite="midu2Grt$lcFHA.3184@.TK2MSFTNGP15.phx.gbl" type="cite">
<pre wrap="">Hi All,
Is there any way to know any user Connect / Disconnect from the SQL Server?
Such as: In any kind of "Method" OR "Event Log"
</pre>
</blockquote>
</body>
</html>
--070603060003080705000406--|||Thanks for your reply!
--
Thanks !
"Mike Hodgson" <mike.hodgson@.mallesons.nospam.com>
'?:%23STaOPmcFHA.2736@.TK2MSFTNGP12.phx.gbl...
> From SQL Enterprise manager you can enable logging for all logins (both
> failed & successful) in the Server Properties dialog box (Security tab,
> Security group box, Audit level radio button group). This will cause
> SQL Server to write messages to the SQL errorlog every time a user
> connects to the SQL server (whether it's a successful or failed login
> attempt). But that won't tell you anything about logouts (i.e.
> disconnects).
> Probably the best way to monitor this stuff is with SQL Profiler. You
> can enable the 'Security Audit|Audit Login', 'Security Audit|Audit Login
> Failed' & 'Security Audit|Audit Logout' events. You can get profiler to
> write its trace data to a file or a SQL table so that you can query
> against that data at a later time.
> That would be about as close to an "event log" containing both logout &
> login information that you can get your hands on. There's no way,
> without altering the SQL Server binaries, to hook into the login/logout
> event of a SQL server.
> BTW, you ought to try to restrict your post to one or, at most, two
> newsgroups.
> --
> *mike hodgson* |/ database administrator/ | mallesons stephen jaques
> *T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
> *E* mailto:mike.hodgson@.mallesons.nospam.com |* W*
> http://www.mallesons.com
>
> SOHO wrote:
>>Hi All,
>>Is there any way to know any user Connect / Disconnect from the SQL
>>Server?
>>Such as: In any kind of "Method" OR "Event Log"
>>
>>
>|||Use profiler to monitor user connection is too expensive.
"SOHO" wrote:
> Thanks for your reply!
> --
> Thanks !
>
> "Mike Hodgson" <mike.hodgson@.mallesons.nospam.com>
> '?:%23STaOPmcFHA.2736@.TK2MSFTNGP12.phx.gbl...
> > From SQL Enterprise manager you can enable logging for all logins (both
> > failed & successful) in the Server Properties dialog box (Security tab,
> > Security group box, Audit level radio button group). This will cause
> > SQL Server to write messages to the SQL errorlog every time a user
> > connects to the SQL server (whether it's a successful or failed login
> > attempt). But that won't tell you anything about logouts (i.e.
> > disconnects).
> >
> > Probably the best way to monitor this stuff is with SQL Profiler. You
> > can enable the 'Security Audit|Audit Login', 'Security Audit|Audit Login
> > Failed' & 'Security Audit|Audit Logout' events. You can get profiler to
> > write its trace data to a file or a SQL table so that you can query
> > against that data at a later time.
> >
> > That would be about as close to an "event log" containing both logout &
> > login information that you can get your hands on. There's no way,
> > without altering the SQL Server binaries, to hook into the login/logout
> > event of a SQL server.
> >
> > BTW, you ought to try to restrict your post to one or, at most, two
> > newsgroups.
> >
> > --
> > *mike hodgson* |/ database administrator/ | mallesons stephen jaques
> > *T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
> > *E* mailto:mike.hodgson@.mallesons.nospam.com |* W*
> > http://www.mallesons.com
> >
> >
> >
> > SOHO wrote:
> >
> >>Hi All,
> >>
> >>Is there any way to know any user Connect / Disconnect from the SQL
> >>Server?
> >>Such as: In any kind of "Method" OR "Event Log"
> >>
> >>
> >>
> >>
> >
>
>|||SQL Server Profiler does not work for you?
Or use sp_who stored procedure.
"SOHO" <hkwin2000@.hotmail.com> wrote in message
news:u2Grt$lcFHA.3184@.TK2MSFTNGP15.phx.gbl...
> Hi All,
> Is there any way to know any user Connect / Disconnect from the SQL
> Server?
> Such as: In any kind of "Method" OR "Event Log"
>
> --
> Thanks !
>
>

No comments:

Post a Comment