Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 更新SQL Server中的存储过程死锁_Sql Server_Sql Server 2008 - Fatal编程技术网

Sql server 更新SQL Server中的存储过程死锁

Sql server 更新SQL Server中的存储过程死锁,sql-server,sql-server-2008,Sql Server,Sql Server 2008,请帮助我分析死锁,我看到这两个更新存储过程彼此死锁。我无法确定他们在锁定对方什么,以及如何解决僵局问题: 2011-05-19 14:00:15.610 spid23s Deadlock encountered .... Printing deadlock information 2011-05-19 14:00:15.610 spid23s Wait-for graph 2011-05-19 14:00:15.610 spid23s NULL 2011-05-19

请帮助我分析死锁,我看到这两个更新存储过程彼此死锁。我无法确定他们在锁定对方什么,以及如何解决僵局问题:

2011-05-19 14:00:15.610 spid23s      Deadlock encountered .... Printing deadlock information
2011-05-19 14:00:15.610 spid23s      Wait-for graph
2011-05-19 14:00:15.610 spid23s      NULL
2011-05-19 14:00:15.610 spid23s      Node:1
2011-05-19 14:00:15.610 spid23s      PAGE: 28:1:17381               CleanCnt:3 Mode:U Flags: 0x3
2011-05-19 14:00:15.610 spid23s       Grant List 2:
2011-05-19 14:00:15.610 spid23s         Owner:0x000000013A3EE1C0 Mode: U        Flg:0x40 Ref:0 Life:00000001 SPID:238 ECID:0 XactLockInfo: 0x00000002B04199B0
2011-05-19 14:00:15.610 spid23s         SPID: 238 ECID: 0 Statement Type: UPDATE Line #: 18
2011-05-19 14:00:15.610 spid23s         Input Buf: RPC Event: Proc [Database Id = 28 Object Id = 1531152500]
2011-05-19 14:00:15.610 spid23s      Requested by: 
2011-05-19 14:00:15.610 spid23s        ResType:LockOwner Stype:'OR'Xdes:0x000000039F83AE90 Mode: U SPID:215 BatchID:0 ECID:0 TaskProxy:(0x00000002A9A8E538) Value:0xd45ccfc0 Cost:(0/0)
2011-05-19 14:00:15.610 spid23s      NULL
2011-05-19 14:00:15.610 spid23s      Node:2
2011-05-19 14:00:15.610 spid23s      PAGE: 28:1:26081               CleanCnt:2 Mode:U Flags: 0x3
2011-05-19 14:00:15.610 spid23s       Grant List 3:
2011-05-19 14:00:15.610 spid23s         Owner:0x000000043091B9C0 Mode: U        Flg:0x40 Ref:0 Life:00000001 SPID:284 ECID:0 XactLockInfo: 0x000000051D4E1D30
2011-05-19 14:00:15.610 spid23s         SPID: 284 ECID: 0 Statement Type: UPDATE Line #: 9
2011-05-19 14:00:15.610 spid23s         Input Buf: Language Event: up_BulkMailSchedule_ResetStuckItems
2011-05-19 14:00:15.610 spid23s      Requested by: 
2011-05-19 14:00:15.610 spid23s        ResType:LockOwner Stype:'OR'Xdes:0x00000002B0419970 Mode: U SPID:238 BatchID:0 ECID:0 TaskProxy:(0x0000000282C9C538) Value:0xd5770500 Cost:(0/0)
2011-05-19 14:00:15.610 spid23s      NULL
2011-05-19 14:00:15.610 spid23s      Node:3
2011-05-19 14:00:15.610 spid23s      PAGE: 28:1:17381               CleanCnt:3 Mode:U Flags: 0x3
2011-05-19 14:00:15.610 spid23s       Wait List:
2011-05-19 14:00:15.610 spid23s         Owner:0x00000004D45CCFC0 Mode: U        Flg:0x42 Ref:1 Life:00000001 SPID:215 ECID:0 XactLockInfo: 0x000000039F83AED0
2011-05-19 14:00:15.610 spid23s         SPID: 215 ECID: 0 Statement Type: UPDATE Line #: 18
2011-05-19 14:00:15.610 spid23s         Input Buf: RPC Event: Proc [Database Id = 28 Object Id = 1531152500]
2011-05-19 14:00:15.610 spid23s      Requested by: 
2011-05-19 14:00:15.610 spid23s        ResType:LockOwner Stype:'OR'Xdes:0x00000002F346DC60 Mode: U SPID:284 BatchID:0 ECID:1 TaskProxy:(0x00000002E1989360) Value:0xce7f3b00 Cost:(0/0)
2011-05-19 14:00:15.610 spid23s      NULL
2011-05-19 14:00:15.610 spid23s      Node:4
2011-05-19 14:00:15.610 spid23s      Port: 0x00000002E3150380  Xid Slot: 0, Wait Slot: -1, Task: 0x0000000005177948, (Coordinator), Exchange Wait Type: e_waitPipeGetRow, Merging: 0
2011-05-19 14:00:15.610 spid23s       ResType:ExchangeId Stype:'AND' SPID:284 BatchID:0 ECID:0 TaskProxy:(0x00000002E188E510) Value:0x5177948 Cost:(0/10000)
2011-05-19 14:00:15.610 spid23s      NULL
2011-05-19 14:00:15.610 spid23s      Victim Resource Owner:
2011-05-19 14:00:15.610 spid23s       ResType:LockOwner Stype:'OR'Xdes:0x000000039F83AE90 Mode: U SPID:215 BatchID:0 ECID:0 TaskProxy:(0x00000002A9A8E538) Value:0xd45ccfc0 Cost:(0/0)
2011-05-19 14:00:15.610 spid34s      deadlock-list
2011-05-19 14:00:15.610 spid34s       deadlock victim=process4c51948
2011-05-19 14:00:15.610 spid34s        process-list
2011-05-19 14:00:15.610 spid34s         process id=process4c51948 taskpriority=0 logused=0 waitresource=PAGE: 28:1:17381 waittime=5023 ownerId=3636483745 transactionname=UPDATE lasttranstarted=2011-05-19T14:00:10.593 XDES=0x39f83ae90 lockMode=U schedulerid=5 kpid=10884 status=suspended spid=215 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2011-05-19T14:00:02.070 lastbatchcompleted=2011-05-19T14:00:02.070 clientapp=.Net SqlClient Data Provider hostname=xxxhostpid=3544 loginname=test\xxxisolationlevel=read uncommitted (1) xactid=3636483745 currentdb=28 lockTimeout=4294967295 clientoption1=673185824 clientoption2=128056
2011-05-19 14:00:15.610 spid34s          executionStack
2011-05-19 14:00:15.610 spid34s           frame procname=mnAlert.dbo.up_BulkMailSchedule_Get_Items_To_Process line=18 stmtstart=1030 stmtend=2584 sqlhandle=0x03001c007488435bbfd1b600a69e00000100000000000000
2011-05-19 14:00:15.610 spid34s      UPDATE TOP (2048) dbo.BulkMailSchedule
2011-05-19 14:00:15.610 spid34s         SET
2011-05-19 14:00:15.610 spid34s             SelectID = @NewSelectID,
2011-05-19 14:00:15.610 spid34s             ProcessingStatusID = 2,
2011-05-19 14:00:15.610 spid34s             ProcessingStatusDate = GETDATE(),
2011-05-19 14:00:15.610 spid34s             ProcessingServer = @ProcessingServer,
2011-05-19 14:00:15.610 spid34s             LastAttemptDate = @CurrentDate,
2011-05-19 14:00:15.610 spid34s             NextAttemptDate = dbo.calcNextAttemptDate(@CurrentDate, Frequency, '02:00:00')
2011-05-19 14:00:15.610 spid34s         OUTPUT
2011-05-19 14:00:15.610 spid34s             inserted.MemberID,
2011-05-19 14:00:15.610 spid34s             inserted.GroupID AS CommunityID,
2011-05-19 14:00:15.610 spid34s             inserted.BulkMailTypeID,
2011-05-19 14:00:15.610 spid34s             inserted.Frequency,
2011-05-19 14:00:15.610 spid34s             inserted.LastSentDate,
2011-05-19 14:00:15.610 spid34s             inserted.LastAttemptDate,
2011-05-19 14:00:15.610 spid34s             inserted.NextAttemptDate,
2011-05-19 14:00:15.610 spid34s             inserted.SentCount,
2011-05-19 14:00:15.610 spid34s             inserted.FrequencyUpdateDate,
2011-05-19 14:00:15.610 spid34s             inserted.InsertDate,
2011-05-19 14:00:15.610 spid34s             inserted.SentMemberIDList
2011-05-19 14:00:15.610 spid34s         WHERE
2011-05-19 14:00:15.610 spid34s             SelectID is NULL AND 
2011-05-19 14:00:15.610 spid34s             NextAttemptDate <= GetDate() AND 
2011-05-19 14:00:15.610 spid34s             LastLogonDate > dateadd(dd,-@MaxDaysSinceLastLogin,GETDATE())
2011-05-19 14:00:15.610 spid34s         -- Return search prefs needed     
2011-05-19 14:00:15.610 spid34s          inputbuf
2011-05-19 14:00:15.610 spid34s      Proc [Database Id = 28 Object Id = 1531152500]    
2011-05-19 14:00:15.610 spid34s         process id=process5143b88 taskpriority=0 logused=0 waitresource=PAGE: 28:1:26081 waittime=3380 ownerId=3636479354 transactionname=UPDATE lasttranstarted=2011-05-19T14:00:03.183 XDES=0x2b0419970 lockMode=U schedulerid=11 kpid=2608 status=suspended spid=238 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2011-05-19T14:00:03.183 lastbatchcompleted=2011-05-19T14:00:03.183 clientapp=.Net SqlClient Data Provider hostname=xxxhostpid=380 loginname=test\xxxisolationlevel=read uncommitted (1) xactid=3636479354 currentdb=28 lockTimeout=4294967295 clientoption1=673185824 clientoption2=128056
2011-05-19 14:00:15.610 spid34s          executionStack
2011-05-19 14:00:15.610 spid34s           frame procname=mnAlert.dbo.up_BulkMailSchedule_Get_Items_To_Process line=18 stmtstart=1030 stmtend=2584 sqlhandle=0x03001c007488435bbfd1b600a69e00000100000000000000
2011-05-19 14:00:15.610遇到spid23s死锁。。。。打印死锁信息
2011-05-19 14:00:15.610 spid23s等待图形
2011-05-19 14:00:15.610 spid23s空
2011-05-19 14:00:15.610 spid23s节点:1
2011-05-19 14:00:15.610 spid23s页面:28:1:17381清洁CNT:3模式:U标志:0x3
2011-05-19 14:00:15.610 spid23s拨款清单2:
2011-05-19 14:00:15.610 spid23s所有者:0x000000013EE1C0模式:U Flg:0x40参考:0寿命:00000001 SPID:238 ECID:0 XactLockInfo:0x00000002B04199B0
2011-05-19 14:00:15.610 spid23s SPID:238 ECID:0语句类型:更新行#:18
2011-05-19 14:00:15.610 spid23s输入Buf:RPC事件:Proc[数据库Id=28对象Id=1531152500]
2011-05-19 14:00:15.610 SPID23请求人:
2011-05-19 14:00:15.610 spid23s重新类型:锁所有者类型:'OR'Xdes:0x000000039F83AE90模式:U SPID:215批次ID:0 ECID:0任务代理:(0x00000002A9A8E538)值:0xD45CFC0成本:(0/0)
2011-05-19 14:00:15.610 spid23s空
2011-05-19 14:00:15.610 spid23s节点:2
2011-05-19 14:00:15.610 spid23s页面:28:1:26081清洁CNT:2模式:U标志:0x3
2011-05-19 14:00:15.610 spid23s拨款清单3:
2011-05-19 14:00:15.610 spid23s所有者:0x000000043091B9C0模式:U Flg:0x40参考:0寿命:00000001 SPID:284 ECID:0 XactLockInfo:0x000000051D4E1D30
2011-05-19 14:00:15.610 spid23s SPID:284 ECID:0语句类型:更新行#:9
2011-05-19 14:00:15.610 spid23s输入Buf:语言事件
2011-05-19 14:00:15.610 SPID23请求人:
2011-05-19 14:00:15.610 spid23s重新类型:锁所有者类型:'OR'Xdes:0x00000002B0419970模式:U SPID:238批次ID:0 ECID:0任务代理:(0x0000000282C9C538)值:0xd5770500成本:(0/0)
2011-05-19 14:00:15.610 spid23s空
2011-05-19 14:00:15.610 spid23s节点:3
2011-05-19 14:00:15.610 spid23s页面:28:1:17381清洁CNT:3模式:U标志:0x3
2011-05-19 14:00:15.610 spid23s等待列表:
2011-05-19 14:00:15.610 spid23s所有者:0x00000004D45CFC0模式:U Flg:0x42参考:1寿命:00000001 SPID:215 ECID:0 XactLockInfo:0x000000039F83AED0
2011-05-19 14:00:15.610 spid23s SPID:215 ECID:0语句类型:更新行#:18
2011-05-19 14:00:15.610 spid23s输入Buf:RPC事件:Proc[数据库Id=28对象Id=1531152500]
2011-05-19 14:00:15.610 SPID23请求人:
2011-05-19 14:00:15.610 spid23s重新类型:锁所有者类型:'OR'Xdes:0x00000002F346DC60模式:U SPID:284批ID:0 ECID:1任务代理:(0x00000002E1989360)值:0xce7f3b00成本:(0/0)
2011-05-19 14:00:15.610 spid23s空
2011-05-19 14:00:15.610 spid23s节点:4
2011-05-19 14:00:15.610 spid23s端口:0x00000002E3150380 Xid插槽:0,等待插槽:-1,任务:0x0000000005177948,(协调器),交换等待类型:e_waitPipeGetRow,合并:0
2011-05-19 14:00:15.610 spid23s重新类型:ExchangeId类型:'和'SPID:284批处理ID:0 ECID:0任务代理:(0x00000002E188E510)值:0x5177948成本:(0/10000)
2011-05-19 14:00:15.610 spid23s空
2011-05-19 14:00:15.610 spid23s受害者资源所有者:
2011-05-19 14:00:15.610 spid23s重新类型:锁所有者类型:'OR'Xdes:0x000000039F83AE90模式:U SPID:215批次ID:0 ECID:0任务代理:(0x00000002A9A8E538)值:0xD45CFC0成本:(0/0)
2011-05-19 14:00:15.610 spid34s死锁列表
2011-05-19 14:00:15.610 spid34s死锁受害者=进程4C51948
2011-05-19 14:00:15.610 spid34s工艺清单
2011-05-19 14:00:15.610 spid34s进程id=process4c51948任务优先级=0日志使用=0 waitresource=PAGE:28:1:17381 waittime=5023所有者id=363636483745事务名称=UPDATE lasttranstarted=2011-05-19T14:00:10.593 XDES=0x39f83ae90锁定模式=U schedulerid=5 kpid=10884状态=suspended spid=215 sbid=0 ecid=0优先级=0分期计数=2LastBatchStart=2011-05-19T14:00:02.070 lastbatchcompleted=2011-05-19T14:00:02.070 clientapp=.Net SqlClient数据提供程序主机名=xxxhostpid=3544 loginname=test\xxxisolationlevel=read uncommitted(1)xactid=363636483745 currentdb=28锁定超时=4294967295 ClientOptions 1=673185824 ClientOptions 2=128056
2011-05-19 14:00:15.610 spid34s执行堆栈
2011-05-19 14:00:15.610 spid34s框架procname=mnAlert.dbo.up\U BulkMailSchedule\U Get\U Items\U To\U工艺线=18 stmtstart=1030 STMTDEND=2584 sqlhandle=0x03001C00748435BBFD1B600A69E00000000000000
2011-05-19 14:00:15.610 spid34s更新顶部(2048)dbo.BulkMailSchedule
2011-05-19 14:00:15.610 spid34s套件
2011-05-19 14:00:15.610 spid34s SelectID=@NewSelectID,
2011-05-19 14:00:15.610 spid34s处理状态ID=2,
2011-05-19 14:00:15.610 spid34s ProcessingStatusDate=GETDATE(),
2011-05-19 14:00:15.610 spid34s ProcessingServer=@ProcessingServer,
2011-05-19 14:00:15.610 spid34s LastAttemptDate=@CurrentDate,
2011-05-19 14:00:15.610 spid34s NEXTATTENTDATE=dbo.calcnextATTENTDATE(@CurrentDate,频率'02:00:00')
2011-05-19 14:00:15.610 spid34s输出
2011-05-19 14:00:15.610插入spid34s.MemberID,
2011-05-19 14:00:15.610插入spid34s.GroupID作为社区ID,
2011-05-19 14:00:15.610插入spid34s.BulkMailTypeID,
2011-05-19 14:00:15.610插入spid34s。频率,
2011-05-19 14:00:15.610插入spid34s.LastSentDate,
2011-05-19 14:00:15.610插入spid34s.LastAttemptDate,
2011-05-19 14:00:15.610插入spid34s下一个日期,
2011-05-19 14:00:15.610插入spid34s.SentCount,
2011-05-19 14:00:15.610插入spid34s。频率更新日期,
2011-05-19 14:00:15.610插入spid34s。插入