Hi all,
I have a slowly changing dimension in a dataflow that has been working for months but has now started to consistently give a dead lock error. The deadlock occurs on 2 update statements within the SCD that update the same table. What is odd is
that this only occurs when the package is executed over night by the sql agent, along with other packages. In fact this package is the last to run. If I run the package by itself in visual studio then I dont get any deadlock errors.
The 2 OLE DB commands contain the 2 update statements are involved in the dead lock.
Below is the xml dead lock report:
<?xml version="1.0" encoding="UTF-8"?>
<deadlock>
<victim-list>
<victimProcess id="process3a26e1088" />
</victim-list>
<process-list>
<process id="process3a26e1088" taskpriority="0" logused="0" waitresource="PAGE: 6:1:804 " waittime="3818" ownerId="384366" transactionname="UPDATE" lasttranstarted="2018-11-23T04:25:54.220"
XDES="0x3a9ba7bf0" lockMode="U" schedulerid="1" kpid="6692" status="suspended" spid="60" sbid="0" ecid="3" priority="0" trancount="0" lastbatchstarted="2018-11-23T04:25:54.227"
lastbatchcompleted="2018-11-23T04:25:35.883" lastattention="1900-01-01T00:00:00.883" clientapp="Microsoft SQL Server" hostname="DEVSERVER" hostpid="3540" isolationlevel="read committed (2)" xactid="384366"
currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="92" stmtend="342" sqlhandle="0x0200000041af103bfd14edb26cfeead2b1d411871de2deb10000000000000000000000000000000000000000">unknown</frame>
</executionStack>
<inputbuf>(@P1 datetime,@P2 varchar(15),@P3 varchar(15))UPDATE [TARGET].[DM_CUSTOMER] SET [END_DATE] = @P1 WHERE [ADDRESS_ID] = @P2 AND [CUSTOMER_NUMBER] = @P3 AND [END_DATE] IS NULL</inputbuf>
</process>
<process id="process3763b2108" taskpriority="0" logused="0" waitresource="PAGE: 6:1:3919 " waittime="3818" ownerId="384366" transactionname="UPDATE" lasttranstarted="2018-11-23T04:25:54.220"
XDES="0x3ad2cfbf0" lockMode="U" schedulerid="3" kpid="7480" status="suspended" spid="60" sbid="0" ecid="2" priority="0" trancount="0" lastbatchstarted="2018-11-23T04:25:54.227"
lastbatchcompleted="2018-11-23T04:25:35.883" lastattention="1900-01-01T00:00:00.883" clientapp="Microsoft SQL Server" hostname="DEVSERVER" hostpid="3540" isolationlevel="read committed (2)" xactid="384366"
currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="92" stmtend="342" sqlhandle="0x0200000041af103bfd14edb26cfeead2b1d411871de2deb10000000000000000000000000000000000000000">unknown</frame>
</executionStack>
<inputbuf>(@P1 datetime,@P2 varchar(15),@P3 varchar(15))UPDATE [TARGET].[DM_CUSTOMER] SET [END_DATE] = @P1 WHERE [ADDRESS_ID] = @P2 AND [CUSTOMER_NUMBER] = @P3 AND [END_DATE] IS NULL</inputbuf>
</process>
<process id="process37d1ac108" taskpriority="0" logused="0" waitresource="PAGE: 6:1:804 " waittime="3818" ownerId="384366" transactionname="UPDATE" lasttranstarted="2018-11-23T04:25:54.220"
XDES="0x3a834bbf0" lockMode="U" schedulerid="4" kpid="2840" status="suspended" spid="60" sbid="0" ecid="1" priority="0" trancount="0" lastbatchstarted="2018-11-23T04:25:54.227"
lastbatchcompleted="2018-11-23T04:25:35.883" lastattention="1900-01-01T00:00:00.883" clientapp="Microsoft SQL Server" hostname="DEVSERVER" hostpid="3540" isolationlevel="read committed (2)" xactid="384366"
currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="92" stmtend="342" sqlhandle="0x0200000041af103bfd14edb26cfeead2b1d411871de2deb10000000000000000000000000000000000000000">unknown</frame>
</executionStack>
<inputbuf>(@P1 datetime,@P2 varchar(15),@P3 varchar(15))UPDATE [TARGET].[DM_CUSTOMER] SET [END_DATE] = @P1 WHERE [ADDRESS_ID] = @P2 AND [CUSTOMER_NUMBER] = @P3 AND [END_DATE] IS NULL</inputbuf>
</process>
<process id="process3763b3c28" taskpriority="0" logused="532" waitresource="PAGE: 6:1:759 " waittime="3818" ownerId="384365" transactionname="UPDATE" lasttranstarted="2018-11-23T04:25:54.220"
XDES="0x3ad2cf8e0" lockMode="U" schedulerid="3" kpid="6280" status="suspended" spid="57" sbid="0" ecid="2" priority="0" trancount="0" lastbatchstarted="2018-11-23T04:25:54.227"
lastbatchcompleted="2018-11-23T04:25:36.023" lastattention="1900-01-01T00:00:00.023" clientapp="Microsoft SQL Server" hostname="DEVSERVER" hostpid="3540" isolationlevel="read committed (2)" xactid="384365"
currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="2508" stmtend="6562" sqlhandle="0x020000006f729f2a2179539f008eca58616d84581d1596fe0000000000000000000000000000000000000000">unknown</frame>
</executionStack>
<inputbuf>(@P1 varchar(50),@P2 varchar(61),@P3 varchar(61),@P4 varchar(61),@P5 varchar(65),@P6 nvarchar(1),@P7 varchar(35),@P8 varchar(31),@P9 varchar(15),@P10 varchar(61),@P11 varchar(7),@P12 varchar(61),@P13 varchar(61),@P14
varchar(7),@P15 varchar(15),@P16 varchar(65),@P17 varchar(31),@P18 varchar(15),@P19 varchar(15),@P20 nvarchar(21),@P21 varchar(11),@P22 varchar(31),@P23 varchar(1),@P24 varchar(10),@P25 varchar(21),@P26 varchar(15),@P27 varchar(1),@P28 varchar(1),@P29 varchar(15),@P30
varchar(17),@P31 varchar(300),@P32 varchar(300),@P33 varchar(21),@P34 nvarchar(1),@P35 nvarchar(1),@P36 varchar(1),@P37 varchar(50),@P38 varchar(50),@P39 varchar(10),@P40 varchar(65),@P41 varchar(21),@P42 varchar(21),@P43 varchar(21),@P44 varchar(21),@P45
varchar(11),@P46 varchar(4),@P47 varchar(5),@P48 varchar(7),@P49 varchar(7),@P50 nvarchar(1),@P51 varchar(21),@P52 varchar(40),@P53 varchar(50),@P54 varchar(1),@P55 varchar(1),@P56 varchar(1),@P57 varchar(1),@P58 varchar(1),@P59 varchar(1),@P60 varchar(1),@P61
varchar(31),@P62 var</inputbuf>
</process>
<process id="process37d1adc28" taskpriority="0" logused="532" waitresource="PAGE: 6:1:3992 " waittime="3818" ownerId="384365" transactionname="UPDATE" lasttranstarted="2018-11-23T04:25:54.220"
XDES="0x3a834b8e0" lockMode="U" schedulerid="4" kpid="6484" status="suspended" spid="57" sbid="0" ecid="1" priority="0" trancount="0" lastbatchstarted="2018-11-23T04:25:54.227"
lastbatchcompleted="2018-11-23T04:25:36.023" lastattention="1900-01-01T00:00:00.023" clientapp="Microsoft SQL Server" hostname="DEVSERVER" hostpid="3540" isolationlevel="read committed (2)" xactid="384365"
currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="2508" stmtend="6562" sqlhandle="0x020000006f729f2a2179539f008eca58616d84581d1596fe0000000000000000000000000000000000000000">unknown</frame>
</executionStack>
<inputbuf>(@P1 varchar(50),@P2 varchar(61),@P3 varchar(61),@P4 varchar(61),@P5 varchar(65),@P6 nvarchar(1),@P7 varchar(35),@P8 varchar(31),@P9 varchar(15),@P10 varchar(61),@P11 varchar(7),@P12 varchar(61),@P13 varchar(61),@P14
varchar(7),@P15 varchar(15),@P16 varchar(65),@P17 varchar(31),@P18 varchar(15),@P19 varchar(15),@P20 nvarchar(21),@P21 varchar(11),@P22 varchar(31),@P23 varchar(1),@P24 varchar(10),@P25 varchar(21),@P26 varchar(15),@P27 varchar(1),@P28 varchar(1),@P29 varchar(15),@P30
varchar(17),@P31 varchar(300),@P32 varchar(300),@P33 varchar(21),@P34 nvarchar(1),@P35 nvarchar(1),@P36 varchar(1),@P37 varchar(50),@P38 varchar(50),@P39 varchar(10),@P40 varchar(65),@P41 varchar(21),@P42 varchar(21),@P43 varchar(21),@P44 varchar(21),@P45
varchar(11),@P46 varchar(4),@P47 varchar(5),@P48 varchar(7),@P49 varchar(7),@P50 nvarchar(1),@P51 varchar(21),@P52 varchar(40),@P53 varchar(50),@P54 varchar(1),@P55 varchar(1),@P56 varchar(1),@P57 varchar(1),@P58 varchar(1),@P59 varchar(1),@P60 varchar(1),@P61
varchar(31),@P62 var</inputbuf>
</process>
<process id="process3a26e1c28" taskpriority="0" logused="532" waitresource="PAGE: 6:1:783 " waittime="3818" ownerId="384365" transactionname="UPDATE" lasttranstarted="2018-11-23T04:25:54.220"
XDES="0x3a9ba78e0" lockMode="U" schedulerid="1" kpid="5604" status="suspended" spid="57" sbid="0" ecid="3" priority="0" trancount="0" lastbatchstarted="2018-11-23T04:25:54.227"
lastbatchcompleted="2018-11-23T04:25:36.023" lastattention="1900-01-01T00:00:00.023" clientapp="Microsoft SQL Server" hostname="DEVSERVER" hostpid="3540" isolationlevel="read committed (2)" xactid="384365"
currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="2508" stmtend="6562" sqlhandle="0x020000006f729f2a2179539f008eca58616d84581d1596fe0000000000000000000000000000000000000000">unknown</frame>
</executionStack>
<inputbuf>(@P1 varchar(50),@P2 varchar(61),@P3 varchar(61),@P4 varchar(61),@P5 varchar(65),@P6 nvarchar(1),@P7 varchar(35),@P8 varchar(31),@P9 varchar(15),@P10 varchar(61),@P11 varchar(7),@P12 varchar(61),@P13 varchar(61),@P14
varchar(7),@P15 varchar(15),@P16 varchar(65),@P17 varchar(31),@P18 varchar(15),@P19 varchar(15),@P20 nvarchar(21),@P21 varchar(11),@P22 varchar(31),@P23 varchar(1),@P24 varchar(10),@P25 varchar(21),@P26 varchar(15),@P27 varchar(1),@P28 varchar(1),@P29 varchar(15),@P30
varchar(17),@P31 varchar(300),@P32 varchar(300),@P33 varchar(21),@P34 nvarchar(1),@P35 nvarchar(1),@P36 varchar(1),@P37 varchar(50),@P38 varchar(50),@P39 varchar(10),@P40 varchar(65),@P41 varchar(21),@P42 varchar(21),@P43 varchar(21),@P44 varchar(21),@P45
varchar(11),@P46 varchar(4),@P47 varchar(5),@P48 varchar(7),@P49 varchar(7),@P50 nvarchar(1),@P51 varchar(21),@P52 varchar(40),@P53 varchar(50),@P54 varchar(1),@P55 varchar(1),@P56 varchar(1),@P57 varchar(1),@P58 varchar(1),@P59 varchar(1),@P60 varchar(1),@P61
varchar(31),@P62 var</inputbuf>
</process>
<process id="process3a26b5468" taskpriority="0" logused="10000" waittime="3790" schedulerid="4" kpid="7552" status="suspended" spid="57" sbid="0"
ecid="0" priority="0" trancount="2" lastbatchstarted="2018-11-23T04:25:54.227" lastbatchcompleted="2018-11-23T04:25:36.023" lastattention="1900-01-01T00:00:00.023" clientapp="Microsoft SQL Server"
hostname="DEVSERVER" hostpid="3540" loginname="NT SERVICE\SQLAgent$DEV_BI_SERVER" isolationlevel="read committed (2)" xactid="384365" currentdb="6" lockTimeout="4294967295" clientoption1="671088672"
clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="2508" stmtend="6562" sqlhandle="0x020000006f729f2a2179539f008eca58616d84581d1596fe0000000000000000000000000000000000000000">unknown</frame>
</executionStack>
<inputbuf>(@P1 varchar(50),@P2 varchar(61),@P3 varchar(61),@P4 varchar(61),@P5 varchar(65),@P6 nvarchar(1),@P7 varchar(35),@P8 varchar(31),@P9 varchar(15),@P10 varchar(61),@P11 varchar(7),@P12 varchar(61),@P13 varchar(61),@P14
varchar(7),@P15 varchar(15),@P16 varchar(65),@P17 varchar(31),@P18 varchar(15),@P19 varchar(15),@P20 nvarchar(21),@P21 varchar(11),@P22 varchar(31),@P23 varchar(1),@P24 varchar(10),@P25 varchar(21),@P26 varchar(15),@P27 varchar(1),@P28 varchar(1),@P29 varchar(15),@P30
varchar(17),@P31 varchar(300),@P32 varchar(300),@P33 varchar(21),@P34 nvarchar(1),@P35 nvarchar(1),@P36 varchar(1),@P37 varchar(50),@P38 varchar(50),@P39 varchar(10),@P40 varchar(65),@P41 varchar(21),@P42 varchar(21),@P43 varchar(21),@P44 varchar(21),@P45
varchar(11),@P46 varchar(4),@P47 varchar(5),@P48 varchar(7),@P49 varchar(7),@P50 nvarchar(1),@P51 varchar(21),@P52 varchar(40),@P53 varchar(50),@P54 varchar(1),@P55 varchar(1),@P56 varchar(1),@P57 varchar(1),@P58 varchar(1),@P59 varchar(1),@P60 varchar(1),@P61
varchar(31),@P62 var</inputbuf>
</process>
</process-list>
<resource-list>
<pagelock fileid="1" pageid="804" dbid="6" subresource="FULL" objectname="TEST_WAREHOUSE.TARGET.DM_CUSTOMER" id="lock3a9a28200" mode="U" associatedObjectId="72057594044743680">
<owner-list>
<owner id="process3a26b5468" mode="U" />
</owner-list>
<waiter-list>
<waiter id="process3a26e1088" mode="U" requestType="wait" />
</waiter-list>
</pagelock>
<pagelock fileid="1" pageid="3919" dbid="6" subresource="FULL" objectname="TEST_WAREHOUSE.TARGET.DM_CUSTOMER" id="lock39b107980" mode="U" associatedObjectId="72057594044743680">
<owner-list>
<owner id="process3a26b5468" mode="U" />
</owner-list>
<waiter-list>
<waiter id="process3763b2108" mode="U" requestType="wait" />
</waiter-list>
</pagelock>
<pagelock fileid="1" pageid="804" dbid="6" subresource="FULL" objectname="TEST_WAREHOUSE.TARGET.DM_CUSTOMER" id="lock3a9a28200" mode="U" associatedObjectId="72057594044743680">
<owner-list>
<owner id="process3a26e1088" mode="U" requestType="wait" />
</owner-list>
<waiter-list>
<waiter id="process37d1ac108" mode="U" requestType="wait" />
</waiter-list>
</pagelock>
<pagelock fileid="1" pageid="759" dbid="6" subresource="FULL" objectname="TEST_WAREHOUSE.TARGET.DM_CUSTOMER" id="lock39b0e4f00" mode="U" associatedObjectId="72057594044743680">
<owner-list>
<owner id="process37d1ac108" mode="U" />
</owner-list>
<waiter-list>
<waiter id="process3763b3c28" mode="U" requestType="wait" />
</waiter-list>
</pagelock>
<pagelock fileid="1" pageid="3992" dbid="6" subresource="FULL" objectname="TEST_WAREHOUSE.TARGET.DM_CUSTOMER" id="lock32147ef00" mode="U" associatedObjectId="72057594044743680">
<owner-list>
<owner id="process37d1ac108" mode="U" />
</owner-list>
<waiter-list>
<waiter id="process37d1adc28" mode="U" requestType="wait" />
</waiter-list>
</pagelock>
<pagelock fileid="1" pageid="783" dbid="6" subresource="FULL" objectname="TEST_WAREHOUSE.TARGET.DM_CUSTOMER" id="lock39b0c5780" mode="U" associatedObjectId="72057594044743680">
<owner-list>
<owner id="process3a26e1088" mode="U" />
<owner id="process3763b2108" mode="U" />
</owner-list>
<waiter-list>
<waiter id="process3a26e1c28" mode="U" requestType="wait" />
</waiter-list>
</pagelock>
<exchangeEvent id="Pipe325eb2700" WaitType="e_waitPipeGetRow" nodeId="1">
<owner-list>
<owner id="process3763b3c28" />
<owner id="process3a26e1c28" />
<owner id="process37d1adc28" />
</owner-list>
<waiter-list>
<waiter id="process3a26b5468" />
</waiter-list>
</exchangeEvent>
</resource-list>
</deadlock>