Killing a locked process

  • We are getting a lock from a process whose id is -2. Apparently -2 means it’s an "orphaned distributed transaction" and the way to kill this is to use “KILL uow”. However, the uow (unit of work) for the process in the sys.syslockinfo table is '00000000-0000-0000-0000-000000000000' – which means that it isn’t an “orphaned distributed transaction”. Does anyone know what’s going on and how we kill the process?

    Thank you.

  • There's often more than one entry in that view. Try the following and see if there's more than one entry and, if so, if one of them has a uow

    select * from sys.dm_tran_locks where request_session_id = -2

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the help but all the UOWs are 0000....

    Thanks,

    Elani

  • Did you give this a try:

    1) Use this query to get the UOW (a GUID) of the offending transaction:

    use master

    select distinct req_transactionUOW from syslockinfo

    Note: Ignore the UOW records that are all zeros. “00000000-0000-0000-0000-000000000000”

    2) Use the Kill command, replacing the GUID below with the req_transactionUOW obtained from the query above, to kill the offending transaction:

    KILL 'D5499C66-E398-45CA-BF7E-DC9C194B48CF'

    Link:http://robkraft.spaces.live.com/Blog/cns!E6687F3AB6372637!161.entry

    Mj

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply