2 つの異なるプロセス ID による、同じクラスター化インデックスの排他ロックでデッドロックが発生しています。データベースは RCSI モードです。2 つの質問があります。
1) 2 つの UPDATE ステートメントによる行の重複以外に、これはハッシュの衝突が原因である可能性がありますか?
2) 以下のトレース XML ファイルでは、クエリにパラメータが含まれています。パラメータ値を取得するには、SQL プロファイラでどのイベントをトレースする必要がありますか?
助けに感謝します。ありがとう
トレース XML ファイル
<deadlock-list>
<deadlock victim="process8ad948">
<process-list>
<process id="process8ad948" taskpriority="0" logused="164520" waitresource="KEY: 7:72057601661599744 (01c1926aca97)" waittime="2833" ownerId="7491036" transactionname="user_transaction" lasttranstarted="2012-10-08T13:16:03.067" XDES="0x6b561b950" lockMode="U" schedulerid="4" kpid="2476" status="suspended" spid="94" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2012-10-08T13:16:57.753" lastbatchcompleted="2012-10-08T13:16:57.750" clientapp="PeopleSoft" hostname="STGAAMY-PPSAPP" hostpid="31772" loginname="HRTRNADM" isolationlevel="read committed (2)" xactid="7491036" currentdb="7" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="440" sqlhandle="0x020000007b8741293b8e4d6542633962bc48489d3946a5d1">
UPDATE PS_GP_NEW_RTO_WRK SET ORIG_CAL_RUN_ID = (SELECT DISTINCT C.ORIG_CAL_RUN_ID FROM PS_GP_PYE_PRC_STAT B ,PS_GP_OLD_RTO_WRK C WHERE C.EMPLID BETWEEN @P1 AND @P2 AND C.CAL_RUN_ID=@P3 AND C.EMPLID = PS_GP_NEW_RTO_WRK.EMPLID AND C.CAL_RUN_ID = PS_GP_NEW_RTO_WRK.CAL_RUN_ID AND C.EMPL_RCD = PS_GP_NEW_RTO_WRK.EMPL_RCD AND C.CAL_ID = PS_GP_NEW_RTO_WRK.CAL_ID AND C.GP_PAYGROUP = PS_GP_NEW_RTO_WRK.GP_PAYGROUP AND B.CAL_ID= C.CAL_ID AND B.GP_PAYGROUP= C.GP_PAYGROUP AND B.EMPLID=C.EMPLID AND B.EMPL_RCD=C.EMPL_RCD AND B.ORIG_CAL_RUN_ID=C.ORIG_CAL_RUN_ID AND C.SEL_ACTION IN (N'R',N'Z') AND B.SEL_ACTION=N'A') WHERE EMPLID BETWEEN @P4 AND @P5 AND CAL_RUN_ID=@P6 AND (N'N'=@P7 OR EMPLID IN (SELECT EMPLID FROM PS_GP_GRP_LIST_RUN WHERE RUN_CNTL_ID=@P8 AND OPRID=@P9) ) AND EXISTS (SELECT B.ORIG_CAL_RUN_ID FROM PS_GP_PYE_PRC_STAT B ,PS_GP_OLD_RTO_WRK C WHERE C.EMPLID BETWEEN @P10 AND @P11 AND C.CAL_RUN_ID=@P12 AND C.EMPLID = PS_GP_NEW_RTO_WRK.EMPLID AND C.CAL_RUN_ID = PS_GP_NEW_RTO_WRK.CAL_RUN_ID AND C.EMPL_RCD = PS_GP_NEW_RTO </frame>
<frame procname="unknown" line="1" sqlhandle="0x000000000000000000000000000000000000000000000000">
unknown </frame>
</executionStack>
<inputbuf>
(@P1 nvarchar(508),@P2 nvarchar(508),@P3 nvarchar(508),@P4 nvarchar(508),@P5 nvarchar(508),@P6 nvarchar(508),@P7 nvarchar(508),@P8 nvarchar(508),@P9 nvarchar(508),@P10 nvarchar(508),@P11 nvarchar(508),@P12 nvarchar(508))UPDATE PS_GP_NEW_RTO_WRK SET ORIG_CAL_RUN_ID = (SELECT DISTINCT C.ORIG_CAL_RUN_ID FROM PS_GP_PYE_PRC_STAT B ,PS_GP_OLD_RTO_WRK C WHERE C.EMPLID BETWEEN @P1 AND @P2 AND C.CAL_RUN_ID=@P3 AND C.EMPLID = PS_GP_NEW_RTO_WRK.EMPLID AND C.CAL_RUN_ID = PS_GP_NEW_RTO_WRK.CAL_RUN_ID AND C.EMPL_RCD = PS_GP_NEW_RTO_WRK.EMPL_RCD AND C.CAL_ID = PS_GP_NEW_RTO_WRK.CAL_ID AND C.GP_PAYGROUP = PS_GP_NEW_RTO_WRK.GP_PAYGROUP AND B.CAL_ID= C.CAL_ID AND B.GP_PAYGROUP= C.GP_PAYGROUP AND B.EMPLID=C.EMPLID AND B.EMPL_RCD=C.EMPL_RCD AND B.ORIG_CAL_RUN_ID=C.ORIG_CAL_RUN_ID AND C.SEL_ACTION IN (N'R',N'Z') AND B.SEL_ACTION=N'A') WHERE EMPLID BETWEEN @P4 AND @P5 AND CAL_RUN_ID=@P6 AND (N'N'=@P7 OR EMPLID IN (SELECT EMPLID FROM PS_GP_GRP_LIST_RUN WHERE RUN_CNTL_ID=@P8 AND OPRID=@P9) ) AND EXISTS (SELECT B.ORIG_CAL_RUN_ID FRO </inputbuf>
</process>
<process id="process5ff948" taskpriority="0" logused="2793096" waitresource="KEY: 7:72057601661599744 (9e1bb6c02ace)" waittime="1659" ownerId="7509883" transactionname="user_transaction" lasttranstarted="2012-10-08T13:16:50.867" XDES="0x6b6beb950" lockMode="U" schedulerid="1" kpid="2472" status="suspended" spid="95" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2012-10-08T13:16:59.400" lastbatchcompleted="2012-10-08T13:16:59.400" clientapp="PeopleSoft" hostname="STGAAMY-PPSAPP" hostpid="32912" loginname="HRTRNADM" isolationlevel="read committed (2)" xactid="7509883" currentdb="7" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="440" sqlhandle="0x020000007b8741293b8e4d6542633962bc48489d3946a5d1">
UPDATE PS_GP_NEW_RTO_WRK SET ORIG_CAL_RUN_ID = (SELECT DISTINCT C.ORIG_CAL_RUN_ID FROM PS_GP_PYE_PRC_STAT B ,PS_GP_OLD_RTO_WRK C WHERE C.EMPLID BETWEEN @P1 AND @P2 AND C.CAL_RUN_ID=@P3 AND C.EMPLID = PS_GP_NEW_RTO_WRK.EMPLID AND C.CAL_RUN_ID = PS_GP_NEW_RTO_WRK.CAL_RUN_ID AND C.EMPL_RCD = PS_GP_NEW_RTO_WRK.EMPL_RCD AND C.CAL_ID = PS_GP_NEW_RTO_WRK.CAL_ID AND C.GP_PAYGROUP = PS_GP_NEW_RTO_WRK.GP_PAYGROUP AND B.CAL_ID= C.CAL_ID AND B.GP_PAYGROUP= C.GP_PAYGROUP AND B.EMPLID=C.EMPLID AND B.EMPL_RCD=C.EMPL_RCD AND B.ORIG_CAL_RUN_ID=C.ORIG_CAL_RUN_ID AND C.SEL_ACTION IN (N'R',N'Z') AND B.SEL_ACTION=N'A') WHERE EMPLID BETWEEN @P4 AND @P5 AND CAL_RUN_ID=@P6 AND (N'N'=@P7 OR EMPLID IN (SELECT EMPLID FROM PS_GP_GRP_LIST_RUN WHERE RUN_CNTL_ID=@P8 AND OPRID=@P9) ) AND EXISTS (SELECT B.ORIG_CAL_RUN_ID FROM PS_GP_PYE_PRC_STAT B ,PS_GP_OLD_RTO_WRK C WHERE C.EMPLID BETWEEN @P10 AND @P11 AND C.CAL_RUN_ID=@P12 AND C.EMPLID = PS_GP_NEW_RTO_WRK.EMPLID AND C.CAL_RUN_ID = PS_GP_NEW_RTO_WRK.CAL_RUN_ID AND C.EMPL_RCD = PS_GP_NEW_RTO </frame>
<frame procname="unknown" line="1" sqlhandle="0x000000000000000000000000000000000000000000000000">
unknown </frame>
</executionStack>
<inputbuf>
(@P1 nvarchar(508),@P2 nvarchar(508),@P3 nvarchar(508),@P4 nvarchar(508),@P5 nvarchar(508),@P6 nvarchar(508),@P7 nvarchar(508),@P8 nvarchar(508),@P9 nvarchar(508),@P10 nvarchar(508),@P11 nvarchar(508),@P12 nvarchar(508))UPDATE PS_GP_NEW_RTO_WRK SET ORIG_CAL_RUN_ID = (SELECT DISTINCT C.ORIG_CAL_RUN_ID FROM PS_GP_PYE_PRC_STAT B ,PS_GP_OLD_RTO_WRK C WHERE C.EMPLID BETWEEN @P1 AND @P2 AND C.CAL_RUN_ID=@P3 AND C.EMPLID = PS_GP_NEW_RTO_WRK.EMPLID AND C.CAL_RUN_ID = PS_GP_NEW_RTO_WRK.CAL_RUN_ID AND C.EMPL_RCD = PS_GP_NEW_RTO_WRK.EMPL_RCD AND C.CAL_ID = PS_GP_NEW_RTO_WRK.CAL_ID AND C.GP_PAYGROUP = PS_GP_NEW_RTO_WRK.GP_PAYGROUP AND B.CAL_ID= C.CAL_ID AND B.GP_PAYGROUP= C.GP_PAYGROUP AND B.EMPLID=C.EMPLID AND B.EMPL_RCD=C.EMPL_RCD AND B.ORIG_CAL_RUN_ID=C.ORIG_CAL_RUN_ID AND C.SEL_ACTION IN (N'R',N'Z') AND B.SEL_ACTION=N'A') WHERE EMPLID BETWEEN @P4 AND @P5 AND CAL_RUN_ID=@P6 AND (N'N'=@P7 OR EMPLID IN (SELECT EMPLID FROM PS_GP_GRP_LIST_RUN WHERE RUN_CNTL_ID=@P8 AND OPRID=@P9) ) AND EXISTS (SELECT B.ORIG_CAL_RUN_ID FRO </inputbuf>
</process>
</process-list>
<resource-list>
<keylock hobtid="72057601661599744" dbid="7" objectname="HRTRN91.dbo.PS_GP_NEW_RTO_WRK" indexname="PS_GP_NEW_RTO_WRK" id="lock4991e6c00" mode="X" associatedObjectId="72057601661599744">
<owner-list>
<owner id="process5ff948" mode="X"/>
</owner-list>
<waiter-list>
<waiter id="process8ad948" mode="U" requestType="wait"/>
</waiter-list>
</keylock>
<keylock hobtid="72057601661599744" dbid="7" objectname="HRTRN91.dbo.PS_GP_NEW_RTO_WRK" indexname="PS_GP_NEW_RTO_WRK" id="lockdf24e800" mode="X" associatedObjectId="72057601661599744">
<owner-list>
<owner id="process8ad948" mode="X"/>
</owner-list>
<waiter-list>
<waiter id="process5ff948" mode="U" requestType="wait"/>
</waiter-list>
</keylock>
</resource-list>
</deadlock>
</deadlock-list>
テーブル構造
CREATE TABLE [dbo].[PS_GP_NEW_RTO_WRK](
[EMPLID] [nvarchar](11) NOT NULL,
[CAL_RUN_ID] [nvarchar](18) NOT NULL,
[EMPL_RCD] [smallint] NOT NULL,
[GP_PAYGROUP] [nvarchar](10) NOT NULL,
[CAL_ID] [nvarchar](18) NOT NULL,
[ORIG_CAL_RUN_ID] [nvarchar](18) NOT NULL,
[RSLT_VER_NUM] [smallint] NOT NULL,
[RSLT_REV_NUM] [smallint] NOT NULL,
[PRC_ORD_TS] [dbo].[PSDATETIME] NULL,
[SEL_STAT] [nvarchar](1) NOT NULL,
[SEL_RSN] [nvarchar](2) NOT NULL,
[RTO_PRC_ID] [nvarchar](10) NOT NULL,
[PYMT_DT] [dbo].[PSDATE] NULL,
[PRC_BGN_DT] [dbo].[PSDATE] NULL,
[PRC_END_DT] [dbo].[PSDATE] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PS_GP_NEW_RTO_WRK] SET (LOCK_ESCALATION = ENABLE)
GO
インデックス構造
CREATE UNIQUE CLUSTERED INDEX [PS_GP_NEW_RTO_WRK] ON [dbo].[PS_GP_NEW_RTO_WRK]
(
[EMPLID] ASC,
[CAL_RUN_ID] ASC,
[EMPL_RCD] ASC,
[GP_PAYGROUP] ASC,
[CAL_ID] ASC,
[ORIG_CAL_RUN_ID] ASC
)
WITH (PAD_INDEX = OFF,
STATISTICS_NORECOMPUTE = OFF,
SORT_IN_TEMPDB = OFF,
IGNORE_DUP_KEY = OFF,
DROP_EXISTING = OFF,
ONLINE = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]