Recently i saw sysprocess due to high CPU usage n i find out that some
process are shoing login_time which is 2-3 hours old. Does this mean that
the process is runnig for 2-3 hours ?How did you identify the process and the login time?
sp_who2?
The LastBatch column indicates the last time that a specific connection
executed a sql statement.
If you are monitoring connections using sp_who2 you can use the CPUTime and
DiskIO columns to "see" how much work a specific connection (SPID) is doing.
Keith Kratochvil
"Vikram" <aa@.aa> wrote in message
news:uPmZqjDdGHA.536@.TK2MSFTNGP02.phx.gbl...
> Recently i saw sysprocess due to high CPU usage n i find out that some
> process are shoing login_time which is 2-3 hours old. Does this mean that
> the process is runnig for 2-3 hours ?
>|||I used following query
SELECT * FROM SYSPROCESSES
where status = 'runnable'
order by cpu desc
login_time is for connection?
that means a connection showing one hour means its live for 1 hour ?
If i want to get the SP execution time, then how to get it ?
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:%23sXEM$DdGHA.4276@.TK2MSFTNGP03.phx.gbl...
> How did you identify the process and the login time?
> sp_who2?
> The LastBatch column indicates the last time that a specific connection
> executed a sql statement.
> If you are monitoring connections using sp_who2 you can use the CPUTime
and
> DiskIO columns to "see" how much work a specific connection (SPID) is
doing.
> --
> Keith Kratochvil
>
> "Vikram" <aa@.aa> wrote in message
> news:uPmZqjDdGHA.536@.TK2MSFTNGP02.phx.gbl...
that
>|||login_time indicates when that connection was opened (connected).
It is possible for a connection to be sitting idle after performing lots of
work.
Is the CPU time increasing for the connection that you are intersted in?
> If i want to get the SP execution time, then how to get it ?
Do you want to know when the last command was executed? If so check the
LastBatch column within sp_who2 for the particular spid.
If you want to know how long a particular stored procedure took to execute
you would need to be running a trace when the stored procedure was called.
I am not aware of a method to get execution time after the fact.
Keith Kratochvil
"Vikram" <aa@.aa> wrote in message
news:ereZcFEdGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I used following query
> SELECT * FROM SYSPROCESSES
> where status = 'runnable'
> order by cpu desc
> login_time is for connection?
> that means a connection showing one hour means its live for 1 hour ?
> If i want to get the SP execution time, then how to get it ?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment