Constant sql server deadlocks

Microsoft SQL Server 2012 (SP1) - 11.0.3460.0 (X64)
  Jul 22 2014 15:22:00
  Copyright (c) Microsoft Corporation
  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
We are using crystal 14.1.3.1257  4.1 Support Pack 3
Why would these kind of deadlocks be occurring every day, how do we stop them?
deadlock-list
deadlock victim=processd73c43c38
  process-list
   process id=processd73c43c38 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (d0cf803f6797) waittime=1609 ownerId=2971464 transactionname=user_transaction lasttranstarted=2015-03-18T20:43:50.390 XDES=0xd48d5b9a8 lockMode=S schedulerid=2 kpid=13556 status=suspended spid=69 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T20:43:50.397 lastbatchcompleted=2015-03-18T20:43:50.397 lastattention=1900-01-01T00:00:00.397 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=2971464 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000dc1fcb0fcc7abd3e45d7c7ff5881be0ee15b01db0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)   
   process id=processd7846f498 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (3ad1942e6b6f) waittime=1609 ownerId=2971463 transactionname=user_transaction lasttranstarted=2015-03-18T20:43:50.390 XDES=0xcd6c75048 lockMode=S schedulerid=1 kpid=2824 status=suspended spid=67 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T20:43:50.397 lastbatchcompleted=2015-03-18T20:43:50.393 lastattention=1900-01-01T00:00:00.393 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=2971463 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000882fcb0bfde505a787fc4763a9325e18c4df2aaf0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)   
  resource-list
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockd5a23d580 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd7846f498 mode=X
    waiter-list
     waiter id=processd73c43c38 mode=S requestType=wait
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockd59be3a00 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd73c43c38 mode=X
    waiter-list
     waiter id=processd7846f498 mode=S requestType=wait
deadlock-list
deadlock victim=processd74059498
  process-list
   process id=processd74059498 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (3ad1942e6b6f) waittime=4673 ownerId=3581373 transactionname=user_transaction lasttranstarted=2015-03-18T21:50:50.100 XDES=0xcd6c40538 lockMode=S schedulerid=3 kpid=2680 status=suspended spid=65 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T21:50:50.103 lastbatchcompleted=2015-03-18T21:50:50.103 lastattention=1900-01-01T00:00:00.103 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=3581373 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000882fcb0bfde505a787fc4763a9325e18c4df2aaf0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)   
   process id=processd73c43c38 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (d0cf803f6797) waittime=4673 ownerId=3581372 transactionname=user_transaction lasttranstarted=2015-03-18T21:50:50.100 XDES=0xd01dce3a8 lockMode=S schedulerid=2 kpid=13556 status=suspended spid=75 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T21:50:50.103 lastbatchcompleted=2015-03-18T21:50:50.103 lastattention=1900-01-01T00:00:00.103 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=3581372 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000dc1fcb0fcc7abd3e45d7c7ff5881be0ee15b01db0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)   
  resource-list
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockd59b77c00 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd73c43c38 mode=X
    waiter-list
     waiter id=processd74059498 mode=S requestType=wait
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockd59be2d80 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd74059498 mode=X
    waiter-list
     waiter id=processd73c43c38 mode=S requestType=wait
deadlock-list
deadlock victim=processd729b3c38
  process-list
   process id=processd729b3c38 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (d0cf803f6797) waittime=1493 ownerId=3780294 transactionname=user_transaction lasttranstarted=2015-03-18T22:13:50.860 XDES=0xcec0039a8 lockMode=S schedulerid=3 kpid=348 status=suspended spid=66 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T22:13:50.863 lastbatchcompleted=2015-03-18T22:13:50.860 lastattention=1900-01-01T00:00:00.860 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=3780294 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000dc1fcb0fcc7abd3e45d7c7ff5881be0ee15b01db0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)   
   process id=processd784cf0c8 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (3ad1942e6b6f) waittime=1493 ownerId=3780293 transactionname=user_transaction lasttranstarted=2015-03-18T22:13:50.860 XDES=0xcbddf16a8 lockMode=S schedulerid=2 kpid=2628 status=suspended spid=75 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T22:13:50.863 lastbatchcompleted=2015-03-18T22:13:50.863 lastattention=1900-01-01T00:00:00.863 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=3780293 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000882fcb0bfde505a787fc4763a9325e18c4df2aaf0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)   
  resource-list
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockccf952d80 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd784cf0c8 mode=X
    waiter-list
     waiter id=processd729b3c38 mode=S requestType=wait
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockd1ad62880 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd729b3c38 mode=X
    waiter-list
     waiter id=processd784cf0c8 mode=S requestType=wait
Log was backed up. Database: HPI_RDS, creation date(time): 2014/03/07(10:56:14), first LSN: 548413:213285:1, last LSN: 548415:81075:1, number of dump devices: 1, device information: (FILE=1, TYPE=VIRTUAL_DEVICE: {'SQLBACKUP_54E08E4E-C38F-40A2-AC98-0F27F9FA056E'}). This is an informational message only. No user action is required.
deadlock-list
deadlock victim=processd72a87868
  process-list
   process id=processd72a87868 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (d0cf803f6797) waittime=3804 ownerId=4140261 transactionname=user_transaction lasttranstarted=2015-03-18T22:43:51.150 XDES=0xce271f9c8 lockMode=S schedulerid=4 kpid=2916 status=suspended spid=73 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T22:43:51.167 lastbatchcompleted=2015-03-18T22:43:51.160 lastattention=1900-01-01T00:00:00.160 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=4140261 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000dc1fcb0fcc7abd3e45d7c7ff5881be0ee15b01db0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (93136)   
   process id=processd74058928 taskpriority=0 logused=856 waitresource=KEY: 18:72057594048806912 (3ad1942e6b6f) waittime=3804 ownerId=4140262 transactionname=user_transaction lasttranstarted=2015-03-18T22:43:51.150 XDES=0xcec03c3a8 lockMode=S schedulerid=3 kpid=2624 status=suspended spid=75 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2015-03-18T22:43:51.167 lastbatchcompleted=2015-03-18T22:43:51.160 lastattention=1900-01-01T00:00:00.160 hostpid=9580 loginname=Reporting isolationlevel=read committed (2) xactid=4140262 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
     frame procname=adhoc line=1 stmtstart=16 sqlhandle=0x02000000a7174825ddbd9d5636ff7bce876499b28f4ae3300000000000000000000000000000000000000000
select LOCKTABLE . PARENTID , LOCKTABLE . CHILDID , 0 , LOCKTABLE . ISMEMBER from dbo . CMS_LOCKS7 LOCKTABLE where LOCKTABLE . CHILDID in ( @0 )    
     frame procname=adhoc line=1 sqlhandle=0x02000000882fcb0bfde505a787fc4763a9325e18c4df2aaf0000000000000000000000000000000000000000
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)    
    inputbuf
SELECT LOCKTABLE.PARENTID,LOCKTABLE.CHILDID,0,LOCKTABLE.ISMEMBER FROM dbo.CMS_LOCKS7 LOCKTABLE WHERE LOCKTABLE.CHILDID IN (4131)   
  resource-list
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockd5a243e80 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd74058928 mode=X
    waiter-list
     waiter id=processd72a87868 mode=S requestType=wait
   keylock hobtid=72057594048806912 dbid=18 objectname=CMS.dbo.CMS_LOCKS7 indexname=CMS_LOCKS7_I4 id=lockd1a638b00 mode=X associatedObjectId=72057594048806912
    owner-list
     owner id=processd72a87868 mode=X
    waiter-list
     waiter id=processd74058928 mode=S requestType=wait

Hi Michael,
The deadlocks are occurring due to the Platform Search Service which is indexing the objects on the database continuously.
The limitation is not with SAP Business Intelligence 4.x, but with the specific SQL databases.
There is an optimization fix now though where the indexing has changed to occur once in 24 hrs and therefore the warnings will occur a lot less. This optimization can be found in BI 4.0 Support Pack 05 and above.
Do keep in mind also that these are just warnings that can be seen in the event viewer and not errors. The indexing will simply be retried.
-You can follow the steps mentioned in the below notes
1640918 - Frequent deadlocks in CMS system database on MS SQL server in SAP BI 4.0(this should stop the deadlocks but you would not be able to search from BI Launchpad)
or
1640934 - How to safely use Platform Search Service in BI 4.0 without overloading the server(this will reduce the number of deadlocks)
Regards,
~Shree

Similar Messages

  • SQL Server deadlocks when distribution manager is updating content

    Hi
    I have a ConfigMgr 2012 environment which consists of a single Primary Site running on SQL Server 2008 R2 SP2 CU8. The environment has been upgraded to SP1 CU3 and I'm noticing that the following deadlock error is occasionally being logged in distmgr.log
    when a package or application is distributed or updated on all distribution points. After the deadlock ends the content successfully distributes.
    An extract of the error from distmgr.log is below
    user(NT AUTHORITY\SYSTEM) runing application(SMS_DISTRIBUTION_MANAGER) from machine (LABCM01.lab.local) is submitting SDK changes from site(LAB) SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:46 PM 11952 (0x2EB0)
    *** IF NOT EXISTS (select 1 from vSMS_SC_SysResUse_Properties where ID = 72057594037927944 and Name = N'AvailableContentLibDrivesList' ~) insert into vSMS_SC_SysResUse_Properties (ID, Name, Value1, Value2, Value3) values (72057594037927944, N'AvailableContentLibDrivesList', N'FFEDC', N'', 0)~ ELSE update vSMS_SC_SysResUse_Properties set ID = 72057594037927944, Name = N'AvailableContentLibDrivesList', Value1 = N'FFEDC', Value2 = N'', Value3 = 0 where ID = 72057594037927944 and Name = N'AvailableContentLibDrivesList' SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:47 PM 1432 (0x0598)
    *** [40001][1205][Microsoft][SQL Server Native Client 11.0][SQL Server]Transaction (Process ID 115) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. : spUpdateSiteControl SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:47 PM 1432 (0x0598)
    CSCItem_Base_Source::UpdateItem: Failed to save item (["Display=\\LABCM01.lab.local\"]MSWNET:["SMS_SITE=LAB"]\\LABCM01.lab.local\,SMS Distribution Point) properties SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:47 PM 1432 (0x0598)
    CSiteSettings::SubmitChanges: Failed to update item(["Display=\\LABCM01.lab.local\"]MSWNET:["SMS_SITE=LAB"]\\LABCM01.lab.local\,SMS Distribution Point) SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:47 PM 1432 (0x0598)
    CSiteSettings::SubmitDeltaSCFToDatabase:Failed to submit changes made from (LAB) SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:47 PM 1432 (0x0598)
    CSiteControlEx::SubmitDeltaSCFFromServerComponent:Failed to submit site control file changes made by componenet SMS_DISTRIBUTION_MANAGER SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:47 PM 1432 (0x0598)
    user(NT AUTHORITY\SYSTEM) runing application(SMS_DISTRIBUTION_MANAGER) from machine (LABCM01.lab.local) is submitting SDK changes from site(LAB) SMS_DISTRIBUTION_MANAGER 3/10/2013 2:08:47 PM 1432 (0x0598)
    Any ideas as to why the occasional deadlocks are occurring? 
    Cheers
    Sam

    Thanks guys, I've managed to capture a deadlock using SQL Profiler and the graph is below.
    Additionally the deadlock XML output is below
    <deadlock-list>
    <deadlock victim="process769288">
    <process-list>
    <process id="process769288" taskpriority="0" logused="1476" waitresource="KEY: 8:72057594111983616 (47c4361ec2ad)" waittime="484" ownerId="273355729" transactionname="user_transaction" lasttranstarted="2013-10-08T21:03:59.523" XDES="0x10b357270" lockMode="U" schedulerid="2" kpid="14220" status="suspended" spid="147" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2013-10-08T21:03:59.527" lastbatchcompleted="2013-10-08T21:03:59.527" clientapp="SMS_DISTRIBUTION_MANAGER" hostname="SHDEPLOY2012" hostpid="4004" loginname="NT AUTHORITY\SYSTEM" isolationlevel="read committed (2)" xactid="273355729" currentdb="8" lockTimeout="4294967295" clientoption1="671287392" clientoption2="128056">
    <executionStack>
    <frame procname="CM_LAB.dbo.spUpdateSiteControl" line="12" stmtstart="622" stmtend="1400" sqlhandle="0x0300080041e141055d1bc40049a200000100000000000000">
    MERGE INTO SiteControl AS T
    USING (
    SELECT @SiteCode AS SiteCode, GETUTCDATE() AS DateLastModified
    ) AS S(SiteCode, DateLastModified)
    ON S.SiteCode = T.SiteCode
    WHEN MATCHED THEN
    UPDATE SET T.DateLastModified = S.DateLastModified
    WHEN NOT MATCHED THEN
    INSERT (SiteCode, DateLastModified)
    VALUES(S.SiteCode, S.DateLastModified); </frame>
    <frame procname="CM_LAB.dbo.tr_SC_SysResUse_Property_ins_upd_del" line="22" stmtstart="1594" stmtend="1672" sqlhandle="0x03000800a1e81749c924c40049a200000000000000000000">
    EXEC spUpdateSiteControl @SiteCode </frame>
    <frame procname="CM_LAB.dbo.tr_vSMS_SysResUse_Properties_upd" line="12" stmtstart="728" stmtend="1374" sqlhandle="0x03000800c63fcf7aa431c40049a200000000000000000000">
    update rel
    set rel.Value1=ins.Value1,
    rel.Value2=ins.Value2,
    rel.Value3=ins.Value3
    from SC_SysResUse_Property as rel
    inner join inserted as ins on rel.Name=ins.Name and rel.SysResUseID=ins.ID
    where rel.Value1!=ins.Value1 or rel.Value2!=ins.Value2 or rel.Value3!=ins.Value3 </frame>
    <frame procname="adhoc" line="3" stmtstart="228" sqlhandle="0x02000000a88e68210a5e17dbd208c883c5925dc10fd661eb">
    UPDATE [vSMS_SC_SysResUse_Properties] set [ID] = @1,[Name] = @2,[Value1] = @3,[Value2] = @4,[Value3] = @5 WHERE [ID]=@6 AND [Name]=@7 </frame>
    <frame procname="adhoc" line="3" stmtstart="586" stmtend="1026" sqlhandle="0x0200000089cc65023756c15d75189d92931f875bffb8980b">
    update vSMS_SC_SysResUse_Properties set ID = 72057594037927953, Name = N&apos;AvailableContentLibDrivesList&apos;, Value1 = N&apos;DDC&apos;, Value2 = N&apos;&apos;, Value3 = 0 where ID = 72057594037927953 and Name = N&apos;AvailableContentLibDrivesList&apos; </frame>
    </executionStack>
    <inputbuf>
    IF NOT EXISTS (select 1 from vSMS_SC_SysResUse_Properties where ID = 72057594037927953 and Name = N&apos;AvailableContentLibDrivesList&apos;
    ) insert into vSMS_SC_SysResUse_Properties (ID, Name, Value1, Value2, Value3) values (72057594037927953, N&apos;AvailableContentLibDrivesList&apos;, N&apos;DDC&apos;, N&apos;&apos;, 0)
    ELSE update vSMS_SC_SysResUse_Properties set ID = 72057594037927953, Name = N&apos;AvailableContentLibDrivesList&apos;, Value1 = N&apos;DDC&apos;, Value2 = N&apos;&apos;, Value3 = 0 where ID = 72057594037927953 and Name = N&apos;AvailableContentLibDrivesList&apos;
    </inputbuf>
    </process>
    <process id="process8fa5a748" taskpriority="0" logused="3160" waitresource="KEY: 8:72057595436728320 (d51fef0ca10c)" waittime="206" ownerId="273355664" transactionname="user_transaction" lasttranstarted="2013-10-08T21:03:59.493" XDES="0x12b176e90" lockMode="U" schedulerid="4" kpid="3812" status="suspended" spid="102" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2013-10-08T21:03:59.800" lastbatchcompleted="2013-10-08T21:03:59.800" clientapp="SMS_DISTRIBUTION_MANAGER" hostname="SHDEPLOY2012" hostpid="4004" loginname="NT AUTHORITY\SYSTEM" isolationlevel="read committed (2)" xactid="273355664" currentdb="8" lockTimeout="4294967295" clientoption1="671156320" clientoption2="128056">
    <executionStack>
    <frame procname="adhoc" line="1" sqlhandle="0x02000000dd107007806e2488472b44e8e2cb235ae39d3ffb">
    delete [vSMS_SC_SysResUse_Properties] where ID=72057594037927955 and Name not in (N&apos;ADSiteName&apos;, N&apos;AllowInternetClients&apos;, N&apos;AvailableContentLibDrivesList&apos;, N&apos;AvailablePkgShareDrivesList&apos;, N&apos;BindPolicy&apos;, N&apos;BITS download&apos;, N&apos;CertificateContextData&apos;, N&apos;CertificateExpirationDate&apos;, N&apos;CertificateFile&apos;, N&apos;CertificatePFXData&apos;, N&apos;CertificateType&apos;, N&apos;DPDrive&apos;, N&apos;DPMonEnabled&apos;, N&apos;DPMonPriority&apos;, N&apos;DPMonSchedule&apos;, N&apos;DPShareDrive&apos;, N&apos;IdentityGUID&apos;, N&apos;IISConfigCheckTimeInterval&apos;, N&apos;InstallInternetServer&apos;, N&apos;IPSubnets&apos;, N&apos;IPv6Prefixes&apos;, N&apos;IsActive&apos;, N&apos;IsAnonymousEnabled&apos;, N&apos;IsMulticast&apos;, N&apos;IsPXE&apos;, N&apos;LastIISConfigCheckTime&apos;, N&apos;MinFreeSpace&apos;, N&apos;PreStagingAllowed&apos;, N&apos;PXEPassword&apos;, N&apos;RemoveWDS&apos;, N&apos;ResponseDelay&apos;, N&apos;Server Remote Name&apos;, N&apos;Server Remote Public Name&apos;, N&apos;SslState&apos;, N&apos;SupportUnknownMachines&apos;, N&apos;UdaSetting&apos;) </frame>
    </executionStack>
    <inputbuf>
    delete [vSMS_SC_SysResUse_Properties] where ID=72057594037927955 and Name not in (N&apos;ADSiteName&apos;, N&apos;AllowInternetClients&apos;, N&apos;AvailableContentLibDrivesList&apos;, N&apos;AvailablePkgShareDrivesList&apos;, N&apos;BindPolicy&apos;, N&apos;BITS download&apos;, N&apos;CertificateContextData&apos;, N&apos;CertificateExpirationDate&apos;, N&apos;CertificateFile&apos;, N&apos;CertificatePFXData&apos;, N&apos;CertificateType&apos;, N&apos;DPDrive&apos;, N&apos;DPMonEnabled&apos;, N&apos;DPMonPriority&apos;, N&apos;DPMonSchedule&apos;, N&apos;DPShareDrive&apos;, N&apos;IdentityGUID&apos;, N&apos;IISConfigCheckTimeInterval&apos;, N&apos;InstallInternetServer&apos;, N&apos;IPSubnets&apos;, N&apos;IPv6Prefixes&apos;, N&apos;IsActive&apos;, N&apos;IsAnonymousEnabled&apos;, N&apos;IsMulticast&apos;, N&apos;IsPXE&apos;, N&apos;LastIISConfigCheckTime&apos;, N&apos;MinFreeSpace&apos;, N&apos;PreStagingAllowed&apos;, N&apos;PXEPassword&apos;, N&apos;RemoveWDS&apos;, N&apos;ResponseDelay&apos;, N&apos;Server Remote Name&apos;, N&apos;Server Remote Public Name&apos;, N&apos;SslState&apos;, N&apos;SupportUnknownMachines&apos;, N&apos;UdaSetting&apos;) </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <keylock hobtid="72057594111983616" dbid="8" objectname="CM_LAB.dbo.SiteControl" indexname="SiteControl_PK" id="lockf8de5880" mode="X" associatedObjectId="72057594111983616">
    <owner-list>
    <owner id="process8fa5a748" mode="X"/>
    </owner-list>
    <waiter-list>
    <waiter id="process769288" mode="U" requestType="wait"/>
    </waiter-list>
    </keylock>
    <keylock hobtid="72057595436728320" dbid="8" objectname="CM_LAB.dbo.SC_SysResUse_Property" indexname="SC_SysResUse_Property_AK" id="lock187f4f680" mode="U" associatedObjectId="72057595436728320">
    <owner-list>
    <owner id="process769288" mode="U"/>
    </owner-list>
    <waiter-list>
    <waiter id="process8fa5a748" mode="U" requestType="wait"/>
    </waiter-list>
    </keylock>
    </resource-list>
    </deadlock>
    </deadlock-list>
    Any ideas? Again this only occasionally happens when content is updated on the distribution points. 
    Thanks
    Sam

  • SQL Server Deadlock issue

    Hello,
    I'm getting deadlock on update statement..Can someone help me how to resolve..?
    Query 1,UPDATE tblICWMST SET SOFLG='W', LCKUSER='MDPA', LCKDATE='20140530 12:55:42 PM' WHERE RECUID=82837 (Recuid is the cluster index)
    Query 2,UPDATE tblSOMAST SET SPECIAL='' WHERE RECUID=1571252  (Recuid is the cluster index)
    Thanks for the reading.

    There is insufficient information to answer the question. Presumably the processes both run a multi-statement transaction have performed an operation on the table which the other process now tries to update.
    This query will return all deadlocks currently registered in the System Health session:
    SELECT
    xed.value('@timestamp', 'datetime2(3)') as CreationDate,
    xed.query('.') AS XEvent
    FROM
    SELECT CAST([target_data] AS XML) AS TargetData
    FROM sys.dm_xe_session_targets AS st
    INNER JOIN sys.dm_xe_sessions AS s
    ON s.address = st.event_session_address
    WHERE s.name = N'system_health'
    AND st.target_name = N'ring_buffer'
    ) AS Data
    CROSS APPLY TargetData.nodes('RingBufferTarget/event[@name="xml_deadlock_report"]') AS XEventData (xed)
    ORDER BY CreationDate DESC
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Errors while Changing the Database to Mutli User Mode from Single user mode in SQL Server 2012

    Hi,
    Good Afternoon :).  Need your help in resolving one of the issue with SQL Server 2012.
    Today, we kept one of the database in the Single User mode and wanted to bring back to Multi User mode.  But we are getting the below error.  There are no user sessions connected to this database which are blocking each other.  I see multiple
    SYSTEM sessions are in blocked state.  The blocking is not cleared even affter restarting the SQL services.
    Verified the SQL Server Errorlog and couldnt get much useful information to troubleshoot the issue.
    pasted the information from the sys.sysprocesses as well for your kind reference.
    Msg 1205, Level 13, State 68, Line 1
    Transaction (Process ID 55) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    Msg 5069, Level 16, State 1, Line 1
    ALTER DATABASE statement failed.
    spid
    kpid
    blocked
    waittype
    waittime
    dbid
    login_time
    status
    cmd
    18
    1004
    36
    0x0005
    144
    5
    4/9/2014 13:13
    background                    
    TASK MANAGER    
    35
    1796
    36
    0x0005
    35
    5
    4/9/2014 13:34
    background                    
    TASK MANAGER    
    36
    2464
    37
    0x0005
    363
    5
    4/9/2014 13:34
    background                    
    TASK MANAGER    
    37
    5100
    36
    0x0005
    254
    5
    4/9/2014 13:04
    background                    
    TASK MANAGER    

    Clearly 36 and 37 are causing deadlock.
    see
    https://www.simple-talk.com/sql/database-administration/handling-deadlocks-in-sql-server/
    http://www.mssqltips.com/sqlservertip/1036/finding-and-troubleshooting-sql-server-deadlocks/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Data Committed instead of Rollback after Deadlock Error in SQL Server 2008 R2 (SP2)

    We're having a strange issue which is occurring only with one Customer having SQL Server 2008 R2 (SP2).
    Basically we have multiple threads uploading data and when an error occurs (like deadlock or any other error). The deadlock victim (process/transaction) is rolledback (from .NET). However the rollback command is not reaching SQL Server as it doesn't show
    in the trace (through SQL Profiler).
    To make things worse, not only the transaction is not being rolled back but the INSERTs executed before the error are being somehow committed, leaving the database in an inconsistent state.
    This is only produced in one environment.
    Any idea what the issue could be?

    All statements are executed with in a Transaction. Under the same scenario this code works perfectly fine for 1000s of customers. Only one customer has this issue.
    You need to capture profiler to check transaction scope.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • DeadLocks on Query Notifications with SQL Server 2008 SP3

    Hello,
    according to this article https://support.microsoft.com/kb/975090 the issue with deadlocks on query notifications should be fixed with SQL Server 2008 SP3 (10.0.5500.0). But we still get deadlocks in the following manner:
    <resource-list>
    <keylock hobtid="72057598393909248" dbid="5" objectname="MyDB.sys.query_notification_1411013420" indexname="cidx" id="lock1731c1f00" mode="RangeX-X" associatedObjectId="72057598393909248">
    <owner-list>
    <owner id="process573dc8" mode="RangeX-X"/>
    </owner-list>
    <waiter-list>
    <waiter id="process58ddc8" mode="RangeS-U" requestType="wait"/>
    </waiter-list>
    </keylock>
    <keylock hobtid="72057598372872192" dbid="5" objectname="MyDB.sys.query_notification_253437289" indexname="cidx" id="lock800c8780" mode="RangeS-U" associatedObjectId="72057598372872192">
    <owner-list>
    <owner id="process58ddc8" mode="RangeS-U"/>
    </owner-list>
    <waiter-list>
    <waiter id="process573dc8" mode="RangeS-U" requestType="wait"/>
    </waiter-list>
    </keylock>
    </resource-list>
    Is there any need to install another fix?
    Thanks in Advance!

    Hello,
    SQL Server 2008 SP4 and all cumulative updates of SP3 do not have fixes related to deadlocks.
    Maybe the following workarounds and solutions can help in your scenario.
    http://stackoverflow.com/questions/3707137/understanding-deadlocks-with-sql-server-query-notifications
    Deadlock Prevention. In case you need to lock multiple conversation groups in a transaction, you need to take the same order to lock the different conversation groups in all transactions, otherwise you will have a deadlock issues.
    Source:
    http://blogs.msdn.com/b/kangmo/archive/2008/12/17/a-brief-guide-on-sql-server-service-broker.aspx
    Try to may transactions more simple and shorter.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Indexing and Deadlock in SQL Server 2008?

    All,
    I am running into a deadlock in SQL Server 2008. Using a profiler I was able to determine that the deadlock happens as I am trying to select and update row(S) in table in 2 different sessions.
    The select query from the profiler is shown below
    select
    nodeinstan0_.id as id35_,
    nodeinstan0_.BPMN_ELEMENT_ID as BPMN2_35_,
    nodeinstan0_.END_DATE as END3_35_,
    nodeinstan0_.NODE_ID as NODE4_35_,
    nodeinstan0_.NODE_INSTANCE_ID as NODE5_35_,
    nodeinstan0_.NODE_NAME as NODE6_35_,
    nodeinstan0_.PROCESS_INSTANCE_ID as PROCESS7_35_,
    nodeinstan0_.START_DATE as START8_35_
    from
    NODE_INSTANCE_LOG nodeinstan0_ where
    nodeinstan0_.NODE_INSTANCE_ID= @P0 and
    nodeinstan0_.PROCESS_INSTANCE_ID= @P1 and
    (nodeinstan0_.END_DATE is null)
    My SQL Scripts for creating the table and index is show below
    CREATE TABLE [dbo].[NODE_INSTANCE_LOG](
    [id] [numeric](19, 0) IDENTITY(1,1) NOT NULL,
    [BPMN_ELEMENT_ID] [varchar](255) NULL,
    [END_DATE] [datetime] NULL,
    [NODE_ID] [varchar](255) NOT NULL,
    [NODE_INSTANCE_ID] [varchar](255) NOT NULL,
    [NODE_NAME] [varchar](2000) NULL,
    [PROCESS_INSTANCE_ID] [numeric](19, 0) NOT NULL,
    [START_DATE] [datetime] NULL,
    PRIMARY KEY CLUSTERED
    [id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
    IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
    ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX IX_NODE_INSTANCE_LOG_Index1
    ON NODE_INSTANCE_LOG(NODE_INSTANCE_ID, PROCESS_INSTANCE_ID, END_DATE)
    INCLUDE
    ( ID, BPMN_ELEMENT_ID, NODE_ID, NODE_NAME, START_DATE);
    As I understood from number of other forums and blogs - I have included the columns under the where clause in the "COVERING index" and the rest of the columns from the select query under non clustered Index. But I am still facing a deadlock.
    Would appreciate if some once can point me in the right direction.
    regards D

    Correction to my earlier observation. Its not a select/update that's causing the deadlock but its a select/select
    I am pasting an extract from the Tracer
    <deadlock victim="process6a9048">
    <process-list>
    <process id="process6a9048" taskpriority="0" logused="15888" waitresource="KEY: 6:72057594142588928 (fbd2e857cffa)" waittime="812" ownerId="1927048" transactionname="implicit_transaction" lasttranstarted="2014-01-03T17:01:35.453" XDES="0x91cd7960" lockMode="S" schedulerid="2" kpid="3640" status="suspended" spid="56" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-01-03T17:01:35.723" lastbatchcompleted="2014-01-03T17:01:35.723" clientapp="jTDS" hostname="LDN-LRM-PC-189" hostpid="123" loginname="username" isolationlevel="read committed (2)" xactid="1927048" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="62" sqlhandle="0x02000000e82b4000ebf38fb66978d5f9f2314a6046f957b3">
    select nodeinstan0_.id as id35_, nodeinstan0_.BPMN_ELEMENT_ID as BPMN2_35_, nodeinstan0_.END_DATE as END3_35_, nodeinstan0_.NODE_ID as NODE4_35_, nodeinstan0_.NODE_INSTANCE_ID as NODE5_35_, nodeinstan0_.NODE_NAME as NODE6_35_, nodeinstan0_.PROCESS_INSTANCE_ID as PROCESS7_35_, nodeinstan0_.START_DATE as START8_35_ from NODE_INSTANCE_LOG nodeinstan0_ where nodeinstan0_.NODE_INSTANCE_ID= @P0 and nodeinstan0_.PROCESS_INSTANCE_ID= @P1 and (nodeinstan0_.END_DATE is null) </frame>
    </executionStack>
    <inputbuf>
    (@P0 nvarchar(4000),@P1 bigint)select nodeinstan0_.id as id35_, nodeinstan0_.BPMN_ELEMENT_ID as BPMN2_35_, nodeinstan0_.END_DATE as END3_35_, nodeinstan0_.NODE_ID as NODE4_35_, nodeinstan0_.NODE_INSTANCE_ID as NODE5_35_, nodeinstan0_.NODE_NAME as NODE6_35_, nodeinstan0_.PROCESS_INSTANCE_ID as PROCESS7_35_, nodeinstan0_.START_DATE as START8_35_ from NODE_INSTANCE_LOG nodeinstan0_ where nodeinstan0_.NODE_INSTANCE_ID= @P0 and nodeinstan0_.PROCESS_INSTANCE_ID= @P1 and (nodeinstan0_.END_DATE is null) </inputbuf>
    </process>
    <process id="process6dddc8" taskpriority="0" logused="114316" waitresource="KEY: 6:72057594142588928 (44ec7e8e62c7)" waittime="602" ownerId="1927022" transactionname="implicit_transaction" lasttranstarted="2014-01-03T17:01:35.227" XDES="0x91d25950" lockMode="S" schedulerid="4" kpid="17412" status="suspended" spid="60" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-01-03T17:01:35.937" lastbatchcompleted="2014-01-03T17:01:35.937" clientapp="jTDS" hostname="LDN-LRM-PC-189" hostpid="123" loginname="username" isolationlevel="read committed (2)" xactid="1927022" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="62" sqlhandle="0x02000000e82b4000ebf38fb66978d5f9f2314a6046f957b3">
    select nodeinstan0_.id as id35_, nodeinstan0_.BPMN_ELEMENT_ID as BPMN2_35_, nodeinstan0_.END_DATE as END3_35_, nodeinstan0_.NODE_ID as NODE4_35_, nodeinstan0_.NODE_INSTANCE_ID as NODE5_35_, nodeinstan0_.NODE_NAME as NODE6_35_, nodeinstan0_.PROCESS_INSTANCE_ID as PROCESS7_35_, nodeinstan0_.START_DATE as START8_35_ from NODE_INSTANCE_LOG nodeinstan0_ where nodeinstan0_.NODE_INSTANCE_ID= @P0 and nodeinstan0_.PROCESS_INSTANCE_ID= @P1 and (nodeinstan0_.END_DATE is null) </frame>
    </executionStack>
    <inputbuf>
    (@P0 nvarchar(4000),@P1 bigint)select nodeinstan0_.id as id35_, nodeinstan0_.BPMN_ELEMENT_ID as BPMN2_35_, nodeinstan0_.END_DATE as END3_35_, nodeinstan0_.NODE_ID as NODE4_35_, nodeinstan0_.NODE_INSTANCE_ID as NODE5_35_, nodeinstan0_.NODE_NAME as NODE6_35_, nodeinstan0_.PROCESS_INSTANCE_ID as PROCESS7_35_, nodeinstan0_.START_DATE as START8_35_ from NODE_INSTANCE_LOG nodeinstan0_ where nodeinstan0_.NODE_INSTANCE_ID= @P0 and nodeinstan0_.PROCESS_INSTANCE_ID= @P1 and (nodeinstan0_.END_DATE is null) </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <keylock hobtid="72057594142588928" dbid="6" objectname="reform.dbo.NODE_INSTANCE_LOG" indexname="IX_NODE_INSTANCE_LOG_Index1" id="lock89f43000" mode="X" associatedObjectId="72057594142588928">
    <owner-list>
    <owner id="process6dddc8" mode="X"/>
    </owner-list>
    <waiter-list>
    <waiter id="process6a9048" mode="S" requestType="wait"/>
    </waiter-list>
    </keylock>
    <keylock hobtid="72057594142588928" dbid="6" objectname="reform.dbo.NODE_INSTANCE_LOG" indexname="IX_NODE_INSTANCE_LOG_Index1" id="lock81b22a80" mode="X" associatedObjectId="72057594142588928">
    <owner-list>
    <owner id="process6a9048" mode="X"/>
    </owner-list>
    <waiter-list>
    <waiter id="process6dddc8" mode="S" requestType="wait"/>
    </waiter-list>
    </keylock>
    </resource-list>
    </deadlock>
    Would appreciate if some one can point out where the issue is.

  • I have enabled both the traces 1204 and 1222 in sql server 2008 but not able to capture deadlocks

    In Application error:
    2014-09-06 12:04:10,140 ERROR [org.apache.catalina.core.ContainerBase] Servlet.service() for servlet DoMethod threw exception
    javax.servlet.ServletException: java.lang.Exception: [ErrorCode] 0010 [ServerError] [DM_SESSION_E_DEADLOCK]error:  "Operation failed due to DBMS Deadlock error." 
    And
    I have enabled both the traces 1204 and 1222 in sql server 2008 but still I am not getting any deadlock in sql server logs.
    Thanks

    Thanks Shanky may be u believe or not but right now I am in a migration of 4 lakh documents in documentum on Production site.
    and the process from documentum is halting due to this error but I am not able to get any deadlock in the sql server while the deadlock error is coming in documentum:
    [ Date ] 2014-09-06 17:54:48,192 [ Priority ] INFO [ Text 3 ] [STDOUT] 17:54:48,192 ERROR [http-0.0.0.0-9080-3] com.bureauveritas.documentum.commons.method.SystemSessionMethod - ERROR 100: problem occured when connecting repository! DfServiceException::
    THREAD: http-0.0.0.0-9080-3; MSG: [DM_SESSION_E_DEADLOCK]error: "Operation failed due to DBMS Deadlock error."; ERRORCODE: 100; NEXT: null at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.checkForDeadlock(NetwiseDocbaseRpcClient.java:276)
    at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.applyForObject(NetwiseDocbaseRpcClient.java:647) at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$8.evaluate(DocbaseConnection.java:1292) at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.evaluateRpc(DocbaseConnection.java:1055)
    at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.applyForObject(DocbaseConnection.java:1284) at com.documentum.fc.client.impl.docbase.DocbaseApi.authenticateUser(DocbaseApi.java:1701) at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.authenticate(DocbaseConnection.java:418)
    at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.open(DocbaseConnection.java:128) at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:97) at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:60)
    at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionFactory.newDocbaseConnection(DocbaseConnectionFactory.java:26) at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionManager.getDocbaseConnection(DocbaseConnectionManager.java:83)
    at com.documentum.fc.client.impl.session.SessionFactory.newSession(SessionFactory.java:29) at com.documentum.fc.client.impl.session.PrincipalAwareSessionFactory.newSession(PrincipalAwareSessionFactory.java:35) at com.documentum.fc.client.impl.session.PooledSessionFactory.newSession(PooledSessionFactory.java:47)
    at com.documentum.fc.client.impl.session.SessionManager.getSessionFromFactory(SessionManager.java:111) at com.documentum.fc.client.impl.session.SessionManager.newSession(SessionManager.java:64) at com.documentum.fc.client.impl.session.SessionManager.getSession(SessionManager.java:168)
    at com.bureauveritas.documentum.commons.method.SystemSessionMethod.execute(Unknown Source) at com.documentum.mthdservlet.DfMethodRunner.runIt(Unknown Source) at com.documentum.mthdservlet.AMethodRunner.runAndReturnStatus(Unknown Source) at com.documentum.mthdservlet.DoMethod.invokeMethod(Unknown
    Source) at com.documentum.mthdservlet.DoMethod.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) (Log Path:SID CER > vmsfrndc01docpp > JMS_Log > server ,Host: vmsfrndc01docpp ,Apps: [SID CER, SID IVS])</init></init>
    Thanks

  • SQL Server 2012 Undetected Deadlock in a table with only one row

      We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
      This is our main database, so most of the applications access it.
      The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
      That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
      After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system.   So, client
    applications start a new transaction, get the current number, increment it by one and commit the transaction.
      The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
      No client application was changed in this migration and this process was working very well for the last 10 years.
      The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
      It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
      I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
      Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?

    First off re: "Unfortunatelly, this can't be used in production environment as exclusive table lock would serialize the accesses to tables and there will be other tables that will suffer with this problem."
    This is incorrect. 
    Using a table to generate sequence numbers like this is a bad idea exactly because the access must be serialized.  Since you can't switch to a SEQUENCE object, which is the correct solution, the _entire goal_ of this exercise to find a way to properly
    serialize access to this table.  Using exclusive locking will not be necessary for all the tables; just for the single-row table used for generating sequence values with a cursor.
    I converted the sample program to VB.NET:
    Public Class Form1
    Private mbCancel As Boolean = False
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim soConn As ADODB.Connection
    Dim soRst As ADODB.Recordset
    Dim sdData As Date
    Dim slValue As Long
    Dim slDelay As Long
    'create database vbtest
    'go
    ' CREATE TABLE [dbo].[ControlNumTest](
    ' [UltData] [datetime] NOT NULL,
    ' [UltNum] [int] NOT NULL,
    ' CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    ' [UltData] Asc
    ' )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
    ' ) ON [PRIMARY]
    mbCancel = False
    Do
    ' Configure the Connection object
    soConn = New ADODB.Connection
    With soConn
    .ConnectionString = "Provider=SQLNCLI11;Initial Catalog=vbtest;Data Source=localhost;trusted_connection=yes"
    .IsolationLevel = ADODB.IsolationLevelEnum.adXactCursorStability
    .Mode = ADODB.ConnectModeEnum.adModeReadWrite
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .Open()
    End With
    ' Start a new transaction
    Call soConn.BeginTrans()
    ' Configure the RecordSet object
    soRst = New ADODB.Recordset
    With soRst
    .ActiveConnection = soConn
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
    .LockType = ADODB.LockTypeEnum.adLockPessimistic
    .Open("SELECT * FROM dbo.ControlNumTest")
    End With
    With soRst
    sdData = .Fields!UltData.Value ' Read the last Date (LOCK INFO 1: See comments bello
    slValue = .Fields!UltNum.Value ' Read the last Number
    If sdData <> Date.Now.Date Then ' Date has changed?
    sdData = Date.Now.Date
    slValue = 1 ' Restart number
    End If
    .Fields!UltData.Value = sdData ' Update data
    .Fields!UltNum.Value = slValue + 1 ' Next number
    End With
    Call soRst.Update()
    Call soRst.Close()
    ' Ends the transaction
    Call soConn.CommitTrans()
    Call soConn.Close()
    soRst = Nothing
    soConn = Nothing
    txtUltNum.Text = slValue + 1 ' Display the last number
    Application.DoEvents()
    slDelay = Int(((Rnd * 250) + 100) / 100) * 100
    System.Threading.Thread.Sleep(slDelay)
    Loop While mbCancel = False
    If mbCancel = True Then
    Call MsgBox("The test was canceled")
    End If
    Exit Sub
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    mbCancel = True
    End Sub
    End Class
    And created the table
    CREATE TABLE [dbo].[ControlNumTest](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go insert into ControlNumTest values (cast(getdate()as date),1)
    Then ran 3 copies of the program and generated the deadlock:
    <deadlock>
    <victim-list>
    <victimProcess id="processf27b1498" />
    </victim-list>
    <process-list>
    <process id="processf27b1498" taskpriority="0" logused="0" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1970" ownerId="3181" transactionname="implicit_transaction" lasttranstarted="2014-02-14T15:49:31.263" XDES="0xf04da3a8" lockMode="X" schedulerid="4" kpid="9700" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="21152" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3181" currentdb="35" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="80" sqlhandle="0x020000008376181f3ad0ea908fe9d8593f2e3ced9882f5c90000000000000000000000000000000000000000">
    UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    (@Param000004 datetime,@Param000005 int)UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </inputbuf>
    </process>
    <process id="processf6ac9498" taskpriority="0" logused="10000" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1971" schedulerid="5" kpid="30516" status="suspended" spid="55" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="27852" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3182" currentdb="35" lockTimeout="4294967295" clientoption1="671156256" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" sqlhandle="0x020000003c6309232ab0edbe0a7790a816a09c4c5ac6f43c0000000000000000000000000000000000000000">
    FETCH API_CURSOR0000000000000001 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    FETCH API_CURSOR0000000000000001 </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf6ac9498" mode="S" />
    <owner id="processf6ac9498" mode="U" requestType="wait" />
    </owner-list>
    <waiter-list>
    <waiter id="processf27b1498" mode="X" requestType="convert" />
    </waiter-list>
    </keylock>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="X" requestType="convert" />
    </owner-list>
    <waiter-list>
    <waiter id="processf6ac9498" mode="U" requestType="wait" />
    </waiter-list>
    </keylock>
    </resource-list>
    </deadlock>
    It's the S lock that comes from the cursor read that's the villian here.  U locks are compatible with S locks, so one session gets a U lock and another gets an S lock.  But then the session with an S needs a U, and the session with a U needs an
    X.  Deadlock. 
    I'm not sure what kind of locks were taken by this cursor code on SQL 2000, but on SQL 2012, this code is absolutely broken and should deadlock.
    The right way to fix this code is to add (UPDLOCK,SERIALIZABLE) to the cursor
    .Open("SELECT * FROM dbo.ControlNumTest with (updlock,serializable)")
    So each session reads the table with a restrictive lock, and you don't mix S, U and X locks in this transaction.  This resolves the deadlock, but requires a code change.
    I tried several things that didn't require a code, which did not resolve the deadlock;
    1) setting ALLOW_ROW_LOCKS=OFF ALLOW_PAGE_LOCKS=OFF
    2) SERIALIZABLE isolation level
    3) Switching OleDB providers from SQLOLEDB to SQLNCLI11
    Then I replaced the table with a view containing a lock hint:
    CREATE TABLE [dbo].[ControlNumTest_t](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go
    create view ControlNumTest as
    select * from ControlNumTest_t with (tablockx)
    Which, at least in my limited testing, resovlved the deadlock without any client code change.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • HOw to avoid DeadLocks when you schedule a Sql Server Agent Job and calling SSIS packages

    Hi All,
    I have scheduled 2 packages in in Sql Server Agent jobs .
    First job which is having Package 1 executing at 11 AM and where I am inserting the data in the table.
    Second job which is having Package 2 executing at 12 AM and where I am updating the data in the table based on the first job inserted records.
    When I am executing my first job it taking more time and executing till 12 AM and from 12 AM my job 2 also starting ,so getting deadlocks conflicts because inserting happening from job1 and updating happening from Job 2.
    How to avoid deadlocks and fix the issue.
    Please Suggest .
    Thanks & Regards,
    Anand

    Hi Anand,
    Here is another solution, you can set the Job 2 not to run based on a schedule, and create another SQL Server Agent Job which starts at 12 AM and run with a specified time interval to execute a SQL statement in which you do the following steps:
    1. Get the status information of Job 1 using the statement:
    DECLARE @i int;
    EXEC @i = msdb.dbo.sp_help_job @job_name = ‘Job Name'
    2. If the value of @i is 1 which means the status of job 1 is success and current time is, then start the job 2. So, the statement is as follows:
    IF @I = 1
    EXEC msdb.dbo.sp_start_job @job_name= ‘Job Name’
    Regards,
    Mike Yin
    TechNet Community Support

  • Deadlocks in Worklist with SQL Server

    I'm looking for information about setting the proper locking configurations for Worklist tables in the SQL Server to minimize deadlock occurrences.
    The server instance console generate the follow exception:
    [java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Transaction (Process ID 130) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.]]
    I retry the transaction using the follow code at Controller.jpf, but the error continue, how i can minimize the problem programatically?
    protected Forward process(ProcessForm form)
    controls.RetryManager retryMng = new controls.RetryManager();
    UserTransaction tx = getUserTransaction();
    try{
    if(!beginTransaction(tx))
    return new Forward( "fail" );
         // process method call many java controls and worklist task
    businessService.process(form.isRaiseError());
    commitTransaction(tx);
    return new Forward( "success" );
    }catch(Exception e){
    rollbackTransaction(tx);
    if(form.getRetries()>0){
         // Retry when SQLException errorCode==1205 || state.equals("40001")
              // Rerun the transaction
    if(retryMng.checkRetry(e)) {
    form.setRetries(form.getRetries()-1);
    return new Forward("retry",form);
    else {
    return new Forward("fail");
         return new Forward( "fail" );
    Full StackTrace:
    479813 <Jun 27, 2006 10:31:53 AM CDT> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(com.bea.wlw.runtime.core.request.Request)],Xid=BEA1-10612213489C2E529A8C(24371849),Status=Rolled back. [Reason=weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
    [java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Transaction (Process ID 130) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=13,seconds left=60,XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=rolledback,assigned=cgServer),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@17396cf,re-Registered = false),XAServerResourceInfo[Juridico Connection Pool]=(ServerResourceInfo[Juridico Connection Pool]=(state=rolledback,assigned=cgServer),xar=Juridico Connection Pool,re-Registered = false),SCInfo[d_cambios+cgServer]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(com.bea.wlw.runtime.core.request.Request)], weblogic.jdbc=t3://172.16.20.136:7001}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1524590, weblogic.ejb20.internal.TxManager$TxListener@19ff424, weblogic.ejb20.internal.TxManager$TxListener@1509a95, weblogic.ejb20.internal.TxManager$TxListener@1791191], weblogic.jdbc.jta.Juridico Connection Pool=weblogic.jdbc.wrapper.TxInfo@1c4e884}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=cgServer+172.16.20.136:7001+d_cambios+t3+, XAResources={JMS_FileStore, JMS_cgJMSStore, Usuario Connection Pool, weblogic.jdbc.wrapper.JTSXAResourceImpl, Juridico Connection Pool},NonXAResources={})],CoordinatorURL=cgServer+172.16.20.136:7001+d_cambios+t3+): java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Transaction (Process ID 130) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
         at weblogic.jdbc.base.BaseExceptions.createException(Ljava/lang/String;Ljava/lang/String;I)Ljava/sql/SQLException;(Unknown Source)
         at weblogic.jdbc.base.BaseExceptions.getException(Ljava/sql/SQLException;II[Ljava/lang/String;Ljava/lang/String;I)Ljava/sql/SQLException;(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRequest.processErrorToken()V(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRequest.processReplyToken(BLweblogic/jdbc/base/BaseWarnings;)Z(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(BLweblogic/jdbc/base/BaseWarnings;)Z(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRequest.processReply(ILweblogic/jdbc/base/BaseWarnings;)V(Unknown Source)
         at weblogic.jdbc.sqlserver.SQLServerImplStatement.getNextResultType()I(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.commonTransitionToState(I)V(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.postImplExecute(Z)V(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.postImplExecute(Z)V(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.commonExecute()V(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.executeUpdateInternal()I(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.executeUpdate()I(Unknown Source)
         at weblogic.jdbcspy.SpyPreparedStatement.executeUpdate()I(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate()I(PreparedStatement.java:147)
         at weblogic.ejb20.manager.BaseEntityManager.executeInsertStmt(Ljava/util/List;Ljavax/transaction/Transaction;Ljava/util/Set;Z)V(BaseEntityManager.java:589)
         at weblogic.ejb20.manager.BaseEntityManager.executeDBOperations(Ljava/util/List;Ljavax/transaction/Transaction;Ljava/util/Set;ZI)V(BaseEntityManager.java:475)
         at weblogic.ejb20.internal.TxManager$TxListener.executeDBOperations(Ljava/util/Set;ZI)V(TxManager.java:585)
         at weblogic.ejb20.internal.TxManager.executeDBOperations(Ljavax/transaction/Transaction;Ljava/util/Set;ZI)V(TxManager.java:151)
         at weblogic.ejb20.manager.BaseEntityManager.executeDBOperations(Ljava/util/Set;ZI)V(BaseEntityManager.java:457)
         at weblogic.ejb20.manager.BaseEntityManager.executeInsertStmt(Ljava/util/List;Ljavax/transaction/Transaction;Ljava/util/Set;Z)V(BaseEntityManager.java:501)
         at weblogic.ejb20.manager.BaseEntityManager.executeDBOperations(Ljava/util/List;Ljavax/transaction/Transaction;Ljava/util/Set;ZI)V(BaseEntityManager.java:475)
         at weblogic.ejb20.internal.TxManager$TxListener.executeDBOperations(Ljava/util/Set;ZI)V(TxManager.java:585)
         at weblogic.ejb20.internal.TxManager$TxListener.executeDBOperationsDriver(Z)V(TxManager.java:560)
         at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion()V(TxManager.java:748)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Lweblogic/transaction/internal/TransactionImpl;)V(ServerSCInfo.java:1026)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Lweblogic/transaction/internal/ServerTransactionImpl;I)V(ServerSCInfo.java:116)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain()V(ServerTransactionImpl.java:1202)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare()V(ServerTransactionImpl.java:1974)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:257)
         at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:228)
         at weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic/ejb20/internal/InvocationWrapper;Ljava/lang/Throwable;)V(BaseEJBObject.java:320)
    --------------- nested within: ------------------
    weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
    [java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Transaction (Process ID 130) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.]
         at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion()V(TxManager.java:760)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Lweblogic/transaction/internal/TransactionImpl;)V(ServerSCInfo.java:1026)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Lweblogic/transaction/internal/ServerTransactionImpl;I)V(ServerSCInfo.java:116)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain()V(ServerTransactionImpl.java:1202)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare()V(ServerTransactionImpl.java:1974)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:257)
         at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:228)
         at weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic/ejb20/internal/InvocationWrapper;Ljava/lang/Throwable;)V(BaseEJBObject.java:320)
         at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(Lweblogic/ejb20/internal/InvocationWrapper;Ljava/lang/Throwable;)V(StatelessEJBObject.java:168)
         at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(Lcom/bea/wlw/runtime/core/request/Request;)Lcom/bea/wlw/runtime/core/request/Response;(SyncDispatcher_k1mrl8_EOImpl.java:56)
         at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Lcom/bea/wlw/runtime/core/dispatcher/DispFile;Lcom/bea/wlw/runtime/core/request/Request;)Lcom/bea/wlw/runtime/core/request/Response;(Dispatcher.java:161)
         at com.bea.wlw.runtime.core.dispatcher.ServiceHandleImpl.invoke(Lcom/bea/wlw/runtime/core/request/Request;)Ljava/lang/Object;(ServiceHandleImpl.java:436)
         at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl._invoke(Lcom/bea/wlw/runtime/core/request/ExecRequest;)Ljava/lang/Object;(WlwProxyImpl.java:326)
         at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;(WlwProxyImpl.java:315)
         at $Proxy18.completarTarea(Ljava/lang/String;)V(Unknown Source)
         at JuicioFiscal.RegistroComplementarioJF.RegistroComplementarioJFController.begin(LAdmonTareas/TareaForm;)Lcom/bea/wlw/netui/pageflow/Forward;(RegistroComplementarioJFController.jpf:700)
         at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava/lang/Object;ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
         at jrockit.reflect.NativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
         at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
         at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source)
         at com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(Ljava/lang/reflect/Method;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;(FlowController.java:1498)
         at com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(Ljava/lang/String;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;(FlowController.java:1433)
         at com.bea.wlw.netui.pageflow.FlowController.internalExecute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(FlowController.java:764)
         at com.bea.wlw.netui.pageflow.PageFlowController.internalExecute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(PageFlowController.java:211)
         at com.bea.wlw.netui.pageflow.FlowController.execute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(FlowController.java:594)
         at org.apache.struts.action.RequestProcessor.processActionPerform(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/Action;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(RequestProcessor.java:274)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(PageFlowRequestProcessor.java:650)
         at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(AutoRegisterActionServlet.java:527)
         at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(PageFlowActionServlet.java:152)
         at org.apache.struts.action.ActionServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(HttpServlet.java:760)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=weblogic.ejb20.internal.TxManager$TxListener@17b710b
    Error writing from beforeCompletion - with nested exception:
    [weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
    [java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Transaction (Process ID 131) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.]]
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException()V(TransactionImpl.java:1684)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:311)
         at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:228)
         at weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic/ejb20/internal/InvocationWrapper;Ljava/lang/Throwable;)V(BaseEJBObject.java:320)
         at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(Lweblogic/ejb20/internal/InvocationWrapper;Ljava/lang/Throwable;)V(StatelessEJBObject.java:168)
         at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(Lcom/bea/wlw/runtime/core/request/Request;)Lcom/bea/wlw/runtime/core/request/Response;(SyncDispatcher_k1mrl8_EOImpl.java:56)
         at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Lcom/bea/wlw/runtime/core/dispatcher/DispFile;Lcom/bea/wlw/runtime/core/request/Request;)Lcom/bea/wlw/runtime/core/request/Response;(Dispatcher.java:161)
         at com.bea.wlw.runtime.core.dispatcher.ServiceHandleImpl.invoke(Lcom/bea/wlw/runtime/core/request/Request;)Ljava/lang/Object;(ServiceHandleImpl.java:436)
         at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl._invoke(Lcom/bea/wlw/runtime/core/request/ExecRequest;)Ljava/lang/Object;(WlwProxyImpl.java:326)
         at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;(WlwProxyImpl.java:315)
         at $Proxy18.completarTarea(Ljava/lang/String;)V(Unknown Source)
         at JuicioFiscal.RegistroComplementarioJF.RegistroComplementarioJFController.begin(LAdmonTareas/TareaForm;)Lcom/bea/wlw/netui/pageflow/Forward;(RegistroComplementarioJFController.jpf:700)
         at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava/lang/Object;ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
         at jrockit.reflect.NativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
         at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
         at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source)
         at com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(Ljava/lang/reflect/Method;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;(FlowController.java:1498)
         at com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(Ljava/lang/String;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;(FlowController.java:1433)
         at com.bea.wlw.netui.pageflow.FlowController.internalExecute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(FlowController.java:764)
         at com.bea.wlw.netui.pageflow.PageFlowController.internalExecute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(PageFlowController.java:211)
         at com.bea.wlw.netui.pageflow.FlowController.execute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(FlowController.java:594)
         at org.apache.struts.action.RequestProcessor.processActionPerform(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/Action;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(RequestProcessor.java:274)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(PageFlowRequestProcessor.java:650)
         at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(AutoRegisterActionServlet.java:527)
         at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(PageFlowActionServlet.java:152)
         at org.apache.struts.action.ActionServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V(ServletStubImpl.java:465)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:348)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

    Put ur driver class files in the class path...
    regards
    Shanu

  • Increase Performance and ROI for SQL Server Environments

    May 2015
    Explore
    The Buzz from Microsoft Ignite 2015
    NetApp was in full force at the recent Microsoft Ignite show in Chicago, talking about solutions for hybrid cloud, and our proven solutions for Microsoft SQL Server and other Microsoft applications.
    Hot topics at the NetApp booth included:
    OnCommand® Shift. A revolutionary technology that lets you move virtual machines back and forth between VMware and Hyper-V environments in minutes.
    Azure Site Recovery to NetApp Private Storage. Replicate on-premises SAN-based applications to NPS for disaster recovery in the Azure cloud.
    These tools give you greater flexibility for managing and protecting important business applications.
    Chris Lemmons
    Director, EIS Technical Marketing, NetApp
    If your organization runs databases such as Microsoft SQL Server and Oracle DB, you probably know that these vendors primarily license their products on a "per-core" basis. Microsoft recently switched to "per-core" rather than "per-socket" licensing for SQL Server 2012 and 2014. This change can have a big impact on the total cost of operating a database, especially as core counts on new servers continue to climb. It turns out that the right storage infrastructure can drive down database costs, increase productivity, and put your infrastructure back in balance.
    In many customer environments, NetApp has noticed that server CPU utilization is low—often on the order of just 20%. This is usually the result of I/O bottlenecks. Server cores have to sit and wait for I/O from hard disk drives (HDDs). We've been closely studying the impact of all-flash storage on SQL Server environments that use HDD-based storage systems. NetApp® All Flash FAS platform delivers world-class performance for SQL Server plus the storage efficiency, application integration, nondisruptive operations, and data protection of clustered Data ONTAP®, making it ideal for SQL Server environments.
    Tests show that All Flash FAS can drive up IOPS and database server CPU utilization by as much as 4x. And with a 95% reduction in latency, you can achieve this level of performance with half as many servers. This reduces the number of servers you need and the number of cores you have to license, driving down costs by 50% or more and paying back your investment in flash in as little as six months.
    Figure 1) NetApp All Flash FAS increases CPU utilization on your SQL Server database servers, lowering costs.
    Source: NetApp, 2015
    Whether you're running one of the newer versions of SQL Server or facing an upgrade of an earlier version, you can't afford not to take a second look at your storage environment.
    End of Support for Microsoft SQL Server 2005 is Rapidly Approaching
    Microsoft has set the end of extended support for SQL Server 2005 for April 2016—less than a year away. With support for Microsoft Windows 2003 ending in July 2015, time may already be running short.
    If you're running Windows Server 2003, new server hardware is almost certainly needed when you upgrade SQL Server. Evaluate your server and storage options now to get costs under control.
    Test Methodology
    To test the impact of flash on SQL Server performance, we replaced a legacy HDD-based storage system with an All Flash FAS AFF8080 EX. The legacy system was configured with almost 150 HDDs, a typical configuration for HDD storage supporting SQL Server. The AFF8080 EX used just 48 SSDs.
    Table 1) Components used in testing.
    Test Configuration Components
    Details
    SQL Server 2014 servers
    Fujitsu RX300
    Server operating system
    Microsoft Windows 2012 R2 Standard Edition
    SQL Server database version
    Microsoft SQL Server 2014 Enterprise Edition
    Processors per server
    2 6-core Xeon E5-2630 at 2.30 GHz
    Fibre channel network
    8Gb FC with multipathing
    Storage controller
    AFF8080 EX
    Data ONTAP version
    Clustered Data ONTAP® 8.3.1
    Drive number and type
    48 SSD
    Source: NetApp, 2015
    The test configuration consisted of 10 database servers connected through fibre channel to both the legacy storage system and the AFF8080 EX. Each of the 10 servers ran SQL Server 2014 Enterprise Edition.
    The publicly available HammerDB workload generator was used to drive an OLTP-like workload simultaneously from each of the 10 database servers to storage. We first directed the workload to the legacy storage array to establish a baseline, increasing the load to the point where read latency consistently exceeded 20ms.
    That workload was then directed at the AFF8080 EX. The change in storage resulted in an overall 20x reduction in read latency, a greater than 4x improvement in IOPS, and a greater than 4x improvement in database server CPU utilization.
    Figure 2) NetApp All Flash FAS increases IOPS and server CPU utilization and lowers latency.
    Source: NetApp, 2015
    In other words, the database servers are able to process four times as many IOPS with dramatically lower latency. CPU utilization goes up accordingly because the servers are processing 4x the work per unit time.
    The All Flash FAS system still had additional headroom under this load.
    Calculating the Savings
    Let's look at what this performance improvement means for the total cost of running SQL Server 2014 over a 3-year period. To do the analysis we used NetApp Realize, a storage modeling and financial analysis tool designed to help quantify the value of NetApp solutions and products. NetApp sales teams and partners use this tool to assist with return on investment (ROI) calculations.
    The calculation includes the cost of the AFF8080 EX, eliminates the costs associated with the existing storage system, and cuts the total number of database servers from 10 to five. This reduces SQL Server licensing costs by 50%. The same workload was run with five servers and achieved the same results. ROI analysis is summarized in Table 2.
    Table 2) ROI from replacing an HDD-based storage system with All Flash FAS, thereby cutting server and licensing costs in half.
    Value
    Analysis Results
    ROI
    65%
    Net present value (NPV)
    $950,000
    Payback period
    six months
    Total cost reduction
    More than $1 million saved over a 3-year analysis period compared to the legacy storage system
    Savings on power, space, and administration
    $40,000
    Additional savings due to nondisruptive operations benefits (not included in ROI)
    $90,000
    Source: NetApp, 2015
    The takeaway here is that you can replace your existing storage with All Flash FAS and get a big performance bump while substantially reducing your costs, with the majority of the savings derived from the reduction in SQL Server licensing costs.
    Replace your existing storage with All Flash FAS and get a big performance bump while substantially reducing your costs.
    Maximum SQL Server 2014 Performance
    In addition to the ROI analysis, we also measured the maximum performance of the AFF8080 EX with SQL Server 2014. A load-generation tool was used to simulate an industry-standard TPC-E OLTP workload against an SQL Server 2014 test configuration.
    A two-node AFF8080 EX achieved a maximum throughput of 322K IOPS at just over 1ms latency. For all points other than the maximum load point, latency was consistently under 1ms and remained under 0.8ms up to 180K IOPS.
    Data Reduction and Storage Efficiency
    In addition to performance testing, we looked at the overall storage efficiency savings of our SQL Server database implementation. The degree of compression that can be achieved is dependent on the actual data that is written and stored in the database. For this environment, inline compression was effective. Deduplication, as is often the case in database environments, provided little additional storage savings and was not enabled.
    For the test data used in the maximum performance test, we measured a compression ratio of 1.5:1. We also tested inline compression on a production SQL Server 2014 data set to further validate these results and saw a 1.8:1 compression ratio.
    Space-efficient NetApp Snapshot® copies provide additional storage efficiency benefits for database environments. Unlike snapshot methods that use copy-on-write, there is no performance penalty; unlike full mirror copies, NetApp Snapshot copies use storage space sparingly. Snapshot copies only consume a small amount of storage space for metadata and additional incremental space is consumed as block-level changes occur. In a typical real-world SQL Server deployment on NetApp storage, database volume Snapshot copies are made every two hours.
    First introduced more than 10 years ago, NetApp FlexClone® technology also plays an important role in SQL Server environments. Clones are fully writable, and, similar to Snapshot copies, only consume incremental storage capacity. With FlexClone, you can create as many copies of production data as you need for development and test, reporting, and so on. Cloning is a great way to support the development and test work needed when upgrading from an earlier version of SQL Server. You'll sometimes see these types of capabilities referred to as "copy data management."
    A Better Way to Run Enterprise Applications
    The performance benefits that all-flash storage can deliver for database environments are significant: more IOPS, lower latency, and an end to near-constant performance tuning.
    If you think the performance acceleration that comes with all-flash storage is cost prohibitive, think again. All Flash FAS doesn't just deliver a performance boost, it changes the economics of your operations, paying for itself with thousands in savings on licensing and server costs. In terms of dollars per IOPS, All Flash FAS is extremely economical relative to HDD.
    And, because All Flash FAS runs NetApp clustered Data ONTAP, it delivers the most complete environment to support SQL Server and all your enterprise applications with capabilities that include comprehensive storage efficiency, integrated data protection, and deep integration for your applications.
    For complete details on this testing look for NetApp TR-4303, which will be available in a few weeks. Stay tuned to Tech OnTap for more information as NetApp continues to run benchmarks with important server workloads including Oracle DB and server virtualization.
    Learn more about NetApp solutions for SQL Server and NetApp All-flash solutions.
    Quick Links
    Tech OnTap Community
    Archive
    PDF

    May 2015
    Explore
    The Buzz from Microsoft Ignite 2015
    NetApp was in full force at the recent Microsoft Ignite show in Chicago, talking about solutions for hybrid cloud, and our proven solutions for Microsoft SQL Server and other Microsoft applications.
    Hot topics at the NetApp booth included:
    OnCommand® Shift. A revolutionary technology that lets you move virtual machines back and forth between VMware and Hyper-V environments in minutes.
    Azure Site Recovery to NetApp Private Storage. Replicate on-premises SAN-based applications to NPS for disaster recovery in the Azure cloud.
    These tools give you greater flexibility for managing and protecting important business applications.
    Chris Lemmons
    Director, EIS Technical Marketing, NetApp
    If your organization runs databases such as Microsoft SQL Server and Oracle DB, you probably know that these vendors primarily license their products on a "per-core" basis. Microsoft recently switched to "per-core" rather than "per-socket" licensing for SQL Server 2012 and 2014. This change can have a big impact on the total cost of operating a database, especially as core counts on new servers continue to climb. It turns out that the right storage infrastructure can drive down database costs, increase productivity, and put your infrastructure back in balance.
    In many customer environments, NetApp has noticed that server CPU utilization is low—often on the order of just 20%. This is usually the result of I/O bottlenecks. Server cores have to sit and wait for I/O from hard disk drives (HDDs). We've been closely studying the impact of all-flash storage on SQL Server environments that use HDD-based storage systems. NetApp® All Flash FAS platform delivers world-class performance for SQL Server plus the storage efficiency, application integration, nondisruptive operations, and data protection of clustered Data ONTAP®, making it ideal for SQL Server environments.
    Tests show that All Flash FAS can drive up IOPS and database server CPU utilization by as much as 4x. And with a 95% reduction in latency, you can achieve this level of performance with half as many servers. This reduces the number of servers you need and the number of cores you have to license, driving down costs by 50% or more and paying back your investment in flash in as little as six months.
    Figure 1) NetApp All Flash FAS increases CPU utilization on your SQL Server database servers, lowering costs.
    Source: NetApp, 2015
    Whether you're running one of the newer versions of SQL Server or facing an upgrade of an earlier version, you can't afford not to take a second look at your storage environment.
    End of Support for Microsoft SQL Server 2005 is Rapidly Approaching
    Microsoft has set the end of extended support for SQL Server 2005 for April 2016—less than a year away. With support for Microsoft Windows 2003 ending in July 2015, time may already be running short.
    If you're running Windows Server 2003, new server hardware is almost certainly needed when you upgrade SQL Server. Evaluate your server and storage options now to get costs under control.
    Test Methodology
    To test the impact of flash on SQL Server performance, we replaced a legacy HDD-based storage system with an All Flash FAS AFF8080 EX. The legacy system was configured with almost 150 HDDs, a typical configuration for HDD storage supporting SQL Server. The AFF8080 EX used just 48 SSDs.
    Table 1) Components used in testing.
    Test Configuration Components
    Details
    SQL Server 2014 servers
    Fujitsu RX300
    Server operating system
    Microsoft Windows 2012 R2 Standard Edition
    SQL Server database version
    Microsoft SQL Server 2014 Enterprise Edition
    Processors per server
    2 6-core Xeon E5-2630 at 2.30 GHz
    Fibre channel network
    8Gb FC with multipathing
    Storage controller
    AFF8080 EX
    Data ONTAP version
    Clustered Data ONTAP® 8.3.1
    Drive number and type
    48 SSD
    Source: NetApp, 2015
    The test configuration consisted of 10 database servers connected through fibre channel to both the legacy storage system and the AFF8080 EX. Each of the 10 servers ran SQL Server 2014 Enterprise Edition.
    The publicly available HammerDB workload generator was used to drive an OLTP-like workload simultaneously from each of the 10 database servers to storage. We first directed the workload to the legacy storage array to establish a baseline, increasing the load to the point where read latency consistently exceeded 20ms.
    That workload was then directed at the AFF8080 EX. The change in storage resulted in an overall 20x reduction in read latency, a greater than 4x improvement in IOPS, and a greater than 4x improvement in database server CPU utilization.
    Figure 2) NetApp All Flash FAS increases IOPS and server CPU utilization and lowers latency.
    Source: NetApp, 2015
    In other words, the database servers are able to process four times as many IOPS with dramatically lower latency. CPU utilization goes up accordingly because the servers are processing 4x the work per unit time.
    The All Flash FAS system still had additional headroom under this load.
    Calculating the Savings
    Let's look at what this performance improvement means for the total cost of running SQL Server 2014 over a 3-year period. To do the analysis we used NetApp Realize, a storage modeling and financial analysis tool designed to help quantify the value of NetApp solutions and products. NetApp sales teams and partners use this tool to assist with return on investment (ROI) calculations.
    The calculation includes the cost of the AFF8080 EX, eliminates the costs associated with the existing storage system, and cuts the total number of database servers from 10 to five. This reduces SQL Server licensing costs by 50%. The same workload was run with five servers and achieved the same results. ROI analysis is summarized in Table 2.
    Table 2) ROI from replacing an HDD-based storage system with All Flash FAS, thereby cutting server and licensing costs in half.
    Value
    Analysis Results
    ROI
    65%
    Net present value (NPV)
    $950,000
    Payback period
    six months
    Total cost reduction
    More than $1 million saved over a 3-year analysis period compared to the legacy storage system
    Savings on power, space, and administration
    $40,000
    Additional savings due to nondisruptive operations benefits (not included in ROI)
    $90,000
    Source: NetApp, 2015
    The takeaway here is that you can replace your existing storage with All Flash FAS and get a big performance bump while substantially reducing your costs, with the majority of the savings derived from the reduction in SQL Server licensing costs.
    Replace your existing storage with All Flash FAS and get a big performance bump while substantially reducing your costs.
    Maximum SQL Server 2014 Performance
    In addition to the ROI analysis, we also measured the maximum performance of the AFF8080 EX with SQL Server 2014. A load-generation tool was used to simulate an industry-standard TPC-E OLTP workload against an SQL Server 2014 test configuration.
    A two-node AFF8080 EX achieved a maximum throughput of 322K IOPS at just over 1ms latency. For all points other than the maximum load point, latency was consistently under 1ms and remained under 0.8ms up to 180K IOPS.
    Data Reduction and Storage Efficiency
    In addition to performance testing, we looked at the overall storage efficiency savings of our SQL Server database implementation. The degree of compression that can be achieved is dependent on the actual data that is written and stored in the database. For this environment, inline compression was effective. Deduplication, as is often the case in database environments, provided little additional storage savings and was not enabled.
    For the test data used in the maximum performance test, we measured a compression ratio of 1.5:1. We also tested inline compression on a production SQL Server 2014 data set to further validate these results and saw a 1.8:1 compression ratio.
    Space-efficient NetApp Snapshot® copies provide additional storage efficiency benefits for database environments. Unlike snapshot methods that use copy-on-write, there is no performance penalty; unlike full mirror copies, NetApp Snapshot copies use storage space sparingly. Snapshot copies only consume a small amount of storage space for metadata and additional incremental space is consumed as block-level changes occur. In a typical real-world SQL Server deployment on NetApp storage, database volume Snapshot copies are made every two hours.
    First introduced more than 10 years ago, NetApp FlexClone® technology also plays an important role in SQL Server environments. Clones are fully writable, and, similar to Snapshot copies, only consume incremental storage capacity. With FlexClone, you can create as many copies of production data as you need for development and test, reporting, and so on. Cloning is a great way to support the development and test work needed when upgrading from an earlier version of SQL Server. You'll sometimes see these types of capabilities referred to as "copy data management."
    A Better Way to Run Enterprise Applications
    The performance benefits that all-flash storage can deliver for database environments are significant: more IOPS, lower latency, and an end to near-constant performance tuning.
    If you think the performance acceleration that comes with all-flash storage is cost prohibitive, think again. All Flash FAS doesn't just deliver a performance boost, it changes the economics of your operations, paying for itself with thousands in savings on licensing and server costs. In terms of dollars per IOPS, All Flash FAS is extremely economical relative to HDD.
    And, because All Flash FAS runs NetApp clustered Data ONTAP, it delivers the most complete environment to support SQL Server and all your enterprise applications with capabilities that include comprehensive storage efficiency, integrated data protection, and deep integration for your applications.
    For complete details on this testing look for NetApp TR-4303, which will be available in a few weeks. Stay tuned to Tech OnTap for more information as NetApp continues to run benchmarks with important server workloads including Oracle DB and server virtualization.
    Learn more about NetApp solutions for SQL Server and NetApp All-flash solutions.
    Quick Links
    Tech OnTap Community
    Archive
    PDF

  • SAP Crystal Report using SQL Server Authentication and Windows Authenticati

    I'm a SAP Crystal Report, version for Visual Studio 2010 Beginner
    my ingredients are
    1.windows 7 ultimate service pack1
    2.sql server 2008 standard edition
    3.visual studio 2010 pro
    4.SAP Crystal Report, version for visual studio.net
    I was created a report named customersByCity.rpt using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> I'm supply Server, User ID, Password and Database. I assume me using SQL Server Authentication for my report
    Then, my ASP.NET files as following
    //ASP.NET
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewCustomersByCity.aspx.cs" Inherits="viewCustomersByCity" %>
    <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div><asp:Label ID="lblMsg" runat="server" BackColor="Yellow" ForeColor="Black"></asp:Label>
     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>
        </div>
        </form>
    </body>
    </html>
    //code-behind
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    public partial class viewCustomersByCity : System.Web.UI.Page
        private const string PARAMETER_FIELD_NAME = "city";   
        private ReportDocument customersByCityReport;
        private void ConfigureCrystalReports()
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo.ServerName = @"WKM1925-PCWKM1925";
            connectionInfo.DatabaseName = "Northwind";
            connectionInfo.UserID = "sa";
            connectionInfo.Password = "sysadmin25";
            SetDBLogonForReport(connectionInfo);
        private void SetDBLogonForReport(ConnectionInfo connectionInfo)
            TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo;
            foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
                tableLogOnInfo.ConnectionInfo = connectionInfo;
        private void SetCurrentValuesForParameterField(ReportDocument reportDocument, ArrayList arrayList)
            ParameterValues currentParameterValues = new ParameterValues();
            foreach (object submittedValue in arrayList)
                ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
                parameterDiscreteValue.Value = submittedValue.ToString();
                currentParameterValues.Add(parameterDiscreteValue);
            ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
            ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions[PARAMETER_FIELD_NAME];
            parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
        protected void Page_Load(object sender, EventArgs e)
            customersByCityReport = new ReportDocument();
            string reportPath = Server.MapPath("customersByCity.rpt");
            customersByCityReport.Load(reportPath);
            ConfigureCrystalReports();
            ArrayList arrayList = new ArrayList();
            arrayList.Add("paris");
            arrayList.Add("Madrid");
            arrayList.Add("Marseille");
            arrayList.Add("Buenos Aires");
            arrayList.Add("Sao Paulo");
            ParameterFields parameterFields = CrystalReportViewer1.ParameterFieldInfo;
            SetCurrentValuesForParameterField(customersByCityReport, arrayList);
            CrystalReportViewer1.ReportSource = customersByCityReport;
    1st scenario
    When in a runtime, it's keep appear a dialog box. This dialog box ask me to suppy Server, User ID, Password and Database. Once all information is supplied, my report display the data as expected
    2nd scenario
    I change my report using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> checked on Integrated Security. I just choose Server, and Database. I assume me using Windows Authentication
    When in a runtime, there's no dialog box as above. My report display the data as expected. really cool
    Look's like, when report using SQL Server Authentication there's some problem. but, when report using Windows Authentication, it's fine.
    I'm looking for comment. Please help me

    Hello,
    MS SQL Server 2008 requires you to install the MS Client Tools for 2008.
    Once install then update all of your reports to use the SQL Native 10 as the OLE DB driver.
    The try again, if it still fails search, lots of sample log on code in this forum.
    Don

  • How can I convert SQL Server 2008 Timestamp to DB2/iSeries Timestamp?

    In DB2/iSeries I have a column that accepts Timestamp value. When I try to insert a timestamp value from the SQL 2008 table and into DB2/iSeries table I recieve the following error message:
    OLE DB provider "IBMDA400" for linked server "XXX" returned message "SQL0180: Syntax of date, time, or timestamp value not valid.
    Cause . . . . . :   The string representation of a date, time, or timestamp value does not conform to the syntax for the specified or implied data type and format. *N is either the character string constant that is not valid or the column or host
    variable that contained the string. If the name is *N, then the value is an expression specified in the statement. If the string was found in a host variable, the host variable number is 1. Recovery  . . . :   Ensure that the date, time, or
    timestamp value conforms to the syntax for the data type it represents. Try the request again.".
    Msg 7343, Level 16, State 2, Line 1
    The OLE DB provider "IBMDA400" for linked server "XXX" could not INSERT INTO table "[IBMDA400]".
    The SQL timestamp column contains the result in the following format:
    2014-04-24 07:39:09.000
    And my insert TSQL command is:
    INSERT INTO OPENQUERY(XXX, 'Select "TimeOfDeal" from ABCD.TICKETS')
    SELECT TimeOfDeal
    FROM dbo.Tickets
    WHERE DealId = 'ABC123'
    I appreciate any help on this issue.

    You are right it is a datetime data type in MS SQL, and a Timestamp in DB2. 
    I cast it to datetime2 and it worked.
    Interesting. I would guess that somewhere under the covers, the date value gets converted to a string, and the different default string formats for datetime and datetime2 is illustrated with this statement:
    SELECT convert(varchar, getdate()), convert(varchar, sysdatetime())
    When I ran it, I got these values:
    Feb 23 2015 12:31PM      2015-02-23 12:31:18.3708899
    Now, why there is a conversion to string in the first place, I'm afraid I don't have any good answer to.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Frequenet dead locks in SQL Server 2008 R2 SP2

    Hi,
    We are experiencing frequent dead locks in our application. We are using MSSQL Server 2008 R2 SP2 version. When our application is configured for 5-6 app servers, this issue is occurring frequently.
    But, when the same application is used with the MSSQL Server 2008 R2 or SQL Server 2012, we don't see the dead lock issue. From the error lock and sql trace, the error message is thrown for the database table JobLock. We have a stored procedure to insert/update
    for the above table when the job moves from one service to other. The same procedure works fine when used with the 2008 R2 and SQL Server 2012 Version.
    Is the above issue related to the hotfix from the below url?
    http://support.microsoft.com/kb/2703275
    Following error message is seen frequently in the log file.
    INFO : 03/24/2014 10:26:30:290 PM: [00007900:00005932] [Xerox.ISP.Workflow.ManagedActivity.PersistInTransaction] System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 62) was deadlocked on lock resources with another process and has been
    chosen as the deadlock victim. Rerun the transaction.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DbCommand command)
       at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command, DbTransaction transaction)
       at Xerox.ISP.DataAccess.Data.Utility.ExecuteNonQuery(TransactionManager transactionManager, DbCommand dbCommand)
       at Xerox.ISP.DataAccess.Data.SqlClient.SqlActivityProviderBase.ActivityReady(TransactionManager transactionManager, Int32 start, Int32 pageLength, Nullable`1 ActivityID, Nullable`1 JobId, String ContentUrl, Nullable`1 PrevWorkStep, Nullable`1
    CurrentWorkStep, String Principal, Nullable`1 Status, Nullable`1 ServerID, String HostName, Nullable`1 LockUserID, Nullable`1& ErrorCode, Byte[]& Activity_TS)
       at Xerox.ISP.DataAccess.Domain.ActivityBase.ActivityReady(Nullable`1 ActivityID, Nullable`1 JobId, String ContentUrl, Nullable`1 PrevWorkStep, Nullable`1 CurrentWorkStep, String Principal, Nullable`1 Status, Nullable`1 ServerID, String HostName,
    Nullable`1 LockUserID, Nullable`1& ErrorCode, Byte[]& Activity_TS, Int32 start, Int32 pageLength)
       at Xerox.ISP.DataAccess.Domain.ActivityBase.ActivityReady(Nullable`1 ActivityID, Nullable`1 JobId, String ContentUrl, Nullable`1 PrevWorkStep, Nullable`1 CurrentWorkStep, String Principal, Nullable`1 Status, Nullable`1 ServerID, String HostName,
    Nullable`1 LockUserID, Nullable`1& ErrorCode, Byte[]& Activity_TS)
       at Xerox.ISP.Workflow.ManagedActivity.<>c__DisplayClass2f.<ActivityReady>b__2d()
       at Xerox.ISP.Workflow.ManagedActivity.PersistInTransaction(Boolean createNew, PersistMethod persist)
    ClientConnectionId:9e44a64f-5014-4634-9cee-4581e1b9c299
    I look forward to the suggestions to get the issue resolved. Your input is much appreciated.
    Thanks,
    Keshava.

    If you are having deadlock trouble in your SQL Server instance, this recipe demonstrates how to make sure deadlocks are logged to the SQL ServerManagement Studio SQL log appropriately using
    the DBCC TRACEON, DBCC TRACEOFF, and DBCC TRACESTATUS commands. These functions enable, disable, and check the status of trace flags.
    To determine the cause of a deadlock, we need to know
    the resources involved and the types of locks acquired and requested. For this kind of information, SQL Server provides
    Trace Flag 1222 (this flag supersedes 1204, which was frequently used in earlier versions of SQL Server.)
    DBCCTRACEON(1222,
    -1);
    GO
    With this flag enabled, SQL Server will provide output in the form of a deadlock graph, showing the executing statements
    for each session, at the time of the deadlock; these are the statements that were blocked and so formed the conflict or cycle that led to the deadlock.
    Be aware that it is rarely possible to guarantee that deadlocks will never occur. Tuning for deadlocks
    primarily involves minimizing the likelihood of their occurrence. Most of the techniques for minimizing the occurrence of deadlocks are similar to the general techniques for minimizing blocking problems.

Maybe you are looking for