Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
viperbyte
Posting Yak Master
132 Posts |
Posted - 2012-12-14 : 13:25:16
|
Hello everyone, second week and still here, whew.What's the effect, damage if any on having a couple of SPIDs hanging around? When I run this script:SELECT LTRIM (st.[text]) AS [Command Text],[host_name], der.session_id AS [SPID], der.[status], db_name(database_id) AS [Database Name], ISNULL(der.wait_type, 'None') AS [Wait Type], der.logical_reads, der.cpu_time, der.total_elapsed_time FROM sys.dm_exec_requests AS derINNER JOIN sys.dm_exec_connections AS dexcON der.session_id = dexc.session_idINNER JOIN sys.dm_exec_sessions AS dexsON dexs.session_id = der.session_idCROSS APPLY sys.dm_exec_sql_text(sql_handle) AS stWHERE der.session_id >= 51AND der.session_id <> @@spid -- eliminate this connectionORDER BY der.[status]I get these two rows of output:Command Text host_name SPID status Database Name Wait Type logical_reads cpu_time total_elapsed_timecreate procedure [sys].[sp_cdc_scan] xxxxx 52 suspended myDB WAITFOR 587108 22479 208296248create procedure[sys].[sp_cdc_scan] xxxxx 53 suspended Document Management WAITFOR 704333 49655 208296247Am I supposed to do something about this? |
|
viperbyte
Posting Yak Master
132 Posts |
Posted - 2012-12-14 : 13:27:08
|
I just read my post and see how tough it is to read the output. 52 and 53 are from the SPID column. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2012-12-14 : 14:00:24
|
They look like they're running Change Data Capture procedures. I don't recommend killing them until you can investigate (check CDC config, is it running? should it be running? etc.) If you don't need CDC then it's better to simply turn it off rather than killing its SPIDs. |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2012-12-15 : 12:11:17
|
It is also useful to include the "blocking_session_id" column from the sys.dm_exec_requests - gives a quick guide on whether the request is being blockedJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
|
|
|
|
|