patternMinor
Session_id: negative number
Viewed 0 times
session_idnumbernegative
Problem
Today, while monitoring my data base I see an special
Anyone would help me to understand what do it please?
session_id with negative number. (-4)Anyone would help me to understand what do it please?
Solution
Per BOL:
I did a write up on it here. However the simple way to get rid of it
I wasn't able to find a whole lot of information on -4 spids. Everything I was able to find sounded like a tempdb issue. This is the solution I use to get rid of -2s but it should work for you:
Take each row from the result and use it to create a KILL statement.
Be warned however we do have a system that gets -2s (I know that's different but even so) on a regular basis and if you kill them it can cause problems with the system. If this is the only time you've seen it I think you'll be fine though.
blocking_session_id
ID of the session that is blocking the request. If this column is NULL, the request is not blocked, or the session information of the blocking session is not available (or cannot be identified).
-2 = The blocking resource is owned by an orphaned distributed transaction.
-3 = The blocking resource is owned by a deferred recovery transaction.
-4 = Session ID of the blocking latch owner could not be determined at this time because of internal latch state transitions.I did a write up on it here. However the simple way to get rid of it
I wasn't able to find a whole lot of information on -4 spids. Everything I was able to find sounded like a tempdb issue. This is the solution I use to get rid of -2s but it should work for you:
SELECT request_owner_guid
FROM sys.dm_tran_locks
WHERE request_session_id = -4Take each row from the result and use it to create a KILL statement.
KILL 'D21D8DAB-C75C-411A-879B-FFDE10E3F397'Be warned however we do have a system that gets -2s (I know that's different but even so) on a regular basis and if you kill them it can cause problems with the system. If this is the only time you've seen it I think you'll be fine though.
Code Snippets
blocking_session_id
ID of the session that is blocking the request. If this column is NULL, the request is not blocked, or the session information of the blocking session is not available (or cannot be identified).
-2 = The blocking resource is owned by an orphaned distributed transaction.
-3 = The blocking resource is owned by a deferred recovery transaction.
-4 = Session ID of the blocking latch owner could not be determined at this time because of internal latch state transitions.SELECT request_owner_guid
FROM sys.dm_tran_locks
WHERE request_session_id = -4KILL 'D21D8DAB-C75C-411A-879B-FFDE10E3F397'Context
StackExchange Database Administrators Q#149467, answer score: 4
Revisions (0)
No revisions yet.