Showing posts with label written. Show all posts
Showing posts with label written. Show all posts

Thursday, March 29, 2012

Deadlocks in the error log

It seems that the information written to the error log about deadlocks
changed in 2005 and I can no longer tell what the numbers mean. Like
for instance, the information after KEY? I can't seem to find sql
server 2005 documentation on this. Can anyone point me to it?
Node:1
KEY: 8:72057594060537856 (9a03c330cb9d) CleanCnt:4 Mode:S Flags: 0x0
Wait List:
Owner:0x000000016A300880 Mode: X Flg:0x2 Ref:1 Life:02000000
SPID:90 ECID:0 XactLockInfo: 0x00000000C69213F8
SPID: 90 ECID: 0 Statement Type: UPDATE Line #: 805
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1535500699]
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x000000015E8F5AD0 Mode: S SPID:91
BatchID:0 ECID:0 TaskProxy0x0000000169426598) Value:0x8011fbc0 Cost5/0)
NULL
Node:2
KEY: 8:72057594060537856 (9a03c330cb9d) CleanCnt:4 Mode:S Flags: 0x0
Grant List 0:
Owner:0x00000000851FAF80 Mode: S Flg:0x0 Ref:0 Life:00000001
SPID:84 ECID:0 XactLockInfo: 0x00000000D431A3A8
SPID: 84 ECID: 0 Statement Type: INSERT Line #: 424
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1052739003]
Grant List 3:
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x00000000C69213C0 Mode: X SPID:90
BatchID:0 ECID:0 TaskProxy0x00000000BE4D8598) Value:0x6a300880
Cost5/8728)
NULL
Node:3
KEY: 8:72057594059882496 (b000142fd0ae) CleanCnt:3 Mode:X Flags: 0x0
Wait List:
Owner:0x0000000100247C00 Mode: S Flg:0x2 Ref:1 Life:00000000
SPID:89 ECID:0 XactLockInfo: 0x0000000123AE8738
SPID: 89 ECID: 0 Statement Type: INSERT Line #: 424
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1052739003]
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x00000000D431A370 Mode: S SPID:84
BatchID:0 ECID:0 TaskProxy0x00000000B7D8C598) Value:0x2a74e200 Cost5/0)
NULL
Node:4
KEY: 8:72057594059882496 (b000142fd0ae) CleanCnt:3 Mode:X Flags: 0x0
Grant List 1:
Owner:0x00000000801A62C0 Mode: X Flg:0x0 Ref:0 Life:02000000
SPID:90 ECID:0 XactLockInfo: 0x00000000C69213F8
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x0000000123AE8700 Mode: S SPID:89
BatchID:0 ECID:0 TaskProxy0x00000000AAE48598) Value:0x247c00 Cost5/0)
NULL
Victim Resource Owner:
ResType:LockOwner Stype:'OR'Xdes:0x0000000123AE8700 Mode: S SPID:89
BatchID:0 ECID:0 TaskProxy0x00000000AAE48598) Value:0x247c00 Cost5/0)
Deadlock encountered ... Printing deadlock information
Wait-for graph
NULLHi, Frank,
Thanks for your post.
From your description, I understand that you would like to know what the
KEY means in SQL error logs.
If I have misunderstood, please let me know.
KEY Identifies the key range within an index on which a lock is held or
requested. KEY is represented as KEY: db_id:hobt_id (index key hash value).
For example, KEY: 6:72057594057457664 (350007a4d329).
For more information, you can refer to:
Detecting and Ending Deadlocks
http://msdn2.microsoft.com/en-us/library/ms178104.aspx
If you have any other questions or concerns, please feel free to let me
know.
Have a good day!
Best regards,
Charles Wang
Microsoft Online Community Support
========================================
=============
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============|||Hi,
I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.
Charles Wang
Microsoft Online Community Support
========================================
==============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============

Deadlocks in the error log

It seems that the information written to the error log about deadlocks
changed in 2005 and I can no longer tell what the numbers mean. Like
for instance, the information after KEY? I can't seem to find sql
server 2005 documentation on this. Can anyone point me to it?
Node:1
KEY: 8:72057594060537856 (9a03c330cb9d) CleanCnt:4 Mode:S Flags: 0x0
Wait List:
Owner:0x000000016A300880 Mode: X Flg:0x2 Ref:1 Life:02000000
SPID:90 ECID:0 XactLockInfo: 0x00000000C69213F8
SPID: 90 ECID: 0 Statement Type: UPDATE Line #: 805
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1535500699]
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x000000015E8F5AD0 Mode: S SPID:91
BatchID:0 ECID:0 TaskProxy0x0000000169426598) Value:0x8011fbc0 Cost5/0)
NULL
Node:2
KEY: 8:72057594060537856 (9a03c330cb9d) CleanCnt:4 Mode:S Flags: 0x0
Grant List 0:
Owner:0x00000000851FAF80 Mode: S Flg:0x0 Ref:0 Life:00000001
SPID:84 ECID:0 XactLockInfo: 0x00000000D431A3A8
SPID: 84 ECID: 0 Statement Type: INSERT Line #: 424
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1052739003]
Grant List 3:
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x00000000C69213C0 Mode: X SPID:90
BatchID:0 ECID:0 TaskProxy0x00000000BE4D8598) Value:0x6a300880
Cost5/8728)
NULL
Node:3
KEY: 8:72057594059882496 (b000142fd0ae) CleanCnt:3 Mode:X Flags: 0x0
Wait List:
Owner:0x0000000100247C00 Mode: S Flg:0x2 Ref:1 Life:00000000
SPID:89 ECID:0 XactLockInfo: 0x0000000123AE8738
SPID: 89 ECID: 0 Statement Type: INSERT Line #: 424
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1052739003]
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x00000000D431A370 Mode: S SPID:84
BatchID:0 ECID:0 TaskProxy0x00000000B7D8C598) Value:0x2a74e200 Cost5/0)
NULL
Node:4
KEY: 8:72057594059882496 (b000142fd0ae) CleanCnt:3 Mode:X Flags: 0x0
Grant List 1:
Owner:0x00000000801A62C0 Mode: X Flg:0x0 Ref:0 Life:02000000
SPID:90 ECID:0 XactLockInfo: 0x00000000C69213F8
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x0000000123AE8700 Mode: S SPID:89
BatchID:0 ECID:0 TaskProxy0x00000000AAE48598) Value:0x247c00 Cost5/0)
NULL
Victim Resource Owner:
ResType:LockOwner Stype:'OR'Xdes:0x0000000123AE8700 Mode: S SPID:89
BatchID:0 ECID:0 TaskProxy0x00000000AAE48598) Value:0x247c00 Cost5/0)
Deadlock encountered ... Printing deadlock information
Wait-for graph
NULL
Hi, Frank,
Thanks for your post.
From your description, I understand that you would like to know what the
KEY means in SQL error logs.
If I have misunderstood, please let me know.
KEY Identifies the key range within an index on which a lock is held or
requested. KEY is represented as KEY: db_id:hobt_id (index key hash value).
For example, KEY: 6:72057594057457664 (350007a4d329).
For more information, you can refer to:
Detecting and Ending Deadlocks
http://msdn2.microsoft.com/en-us/library/ms178104.aspx
If you have any other questions or concerns, please feel free to let me
know.
Have a good day!
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ===
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||Hi,
I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.
Charles Wang
Microsoft Online Community Support
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Deadlocks in the error log

It seems that the information written to the error log about deadlocks
changed in 2005 and I can no longer tell what the numbers mean. Like
for instance, the information after KEY? I can't seem to find sql
server 2005 documentation on this. Can anyone point me to it?
Node:1
KEY: 8:72057594060537856 (9a03c330cb9d) CleanCnt:4 Mode:S Flags: 0x0
Wait List:
Owner:0x000000016A300880 Mode: X Flg:0x2 Ref:1 Life:02000000
SPID:90 ECID:0 XactLockInfo: 0x00000000C69213F8
SPID: 90 ECID: 0 Statement Type: UPDATE Line #: 805
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1535500699]
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x000000015E8F5AD0 Mode: S SPID:91
BatchID:0 ECID:0 TaskProxy:(0x0000000169426598) Value:0x8011fbc0 Cost:(5/0)
NULL
Node:2
KEY: 8:72057594060537856 (9a03c330cb9d) CleanCnt:4 Mode:S Flags: 0x0
Grant List 0:
Owner:0x00000000851FAF80 Mode: S Flg:0x0 Ref:0 Life:00000001
SPID:84 ECID:0 XactLockInfo: 0x00000000D431A3A8
SPID: 84 ECID: 0 Statement Type: INSERT Line #: 424
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1052739003]
Grant List 3:
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x00000000C69213C0 Mode: X SPID:90
BatchID:0 ECID:0 TaskProxy:(0x00000000BE4D8598) Value:0x6a300880
Cost:(5/8728)
NULL
Node:3
KEY: 8:72057594059882496 (b000142fd0ae) CleanCnt:3 Mode:X Flags: 0x0
Wait List:
Owner:0x0000000100247C00 Mode: S Flg:0x2 Ref:1 Life:00000000
SPID:89 ECID:0 XactLockInfo: 0x0000000123AE8738
SPID: 89 ECID: 0 Statement Type: INSERT Line #: 424
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 1052739003]
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x00000000D431A370 Mode: S SPID:84
BatchID:0 ECID:0 TaskProxy:(0x00000000B7D8C598) Value:0x2a74e200 Cost:(5/0)
NULL
Node:4
KEY: 8:72057594059882496 (b000142fd0ae) CleanCnt:3 Mode:X Flags: 0x0
Grant List 1:
Owner:0x00000000801A62C0 Mode: X Flg:0x0 Ref:0 Life:02000000
SPID:90 ECID:0 XactLockInfo: 0x00000000C69213F8
Requested By:
ResType:LockOwner Stype:'OR'Xdes:0x0000000123AE8700 Mode: S SPID:89
BatchID:0 ECID:0 TaskProxy:(0x00000000AAE48598) Value:0x247c00 Cost:(5/0)
NULL
Victim Resource Owner:
ResType:LockOwner Stype:'OR'Xdes:0x0000000123AE8700 Mode: S SPID:89
BatchID:0 ECID:0 TaskProxy:(0x00000000AAE48598) Value:0x247c00 Cost:(5/0)
Deadlock encountered ... Printing deadlock information
Wait-for graph
NULLHi, Frank,
Thanks for your post.
From your description, I understand that you would like to know what the
KEY means in SQL error logs.
If I have misunderstood, please let me know.
KEY Identifies the key range within an index on which a lock is held or
requested. KEY is represented as KEY: db_id:hobt_id (index key hash value).
For example, KEY: 6:72057594057457664 (350007a4d329).
For more information, you can refer to:
Detecting and Ending Deadlocks
http://msdn2.microsoft.com/en-us/library/ms178104.aspx
If you have any other questions or concerns, please feel free to let me
know.
Have a good day!
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||Hi,
I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.
Charles Wang
Microsoft Online Community Support
======================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================

Deadlocks in error log

In the past when a deadlock occurred, it was written into
the SQL Server error logs. I thought this was SQL Server
wide. However, now I'm in a new company and when I created
a deadlock, it wasn't written into the SQL Error logs.
Am I missing a setting somewhere?
Please advise
Thanks
FredHi,
This level of error logging is not by default. Check BOL
on DBCC TRACEON.
Brig
>--Original Message--
>In the past when a deadlock occurred, it was written
into
>the SQL Server error logs. I thought this was SQL Server
>wide. However, now I'm in a new company and when I
created
>a deadlock, it wasn't written into the SQL Error logs.
>Am I missing a setting somewhere?
>Please advise
>Thanks
>Fred
>.
>

Tuesday, March 27, 2012

Deadlocking

I'm looking for any tuning information that you may have
on deadlocking.
I have an APP(not written by me) that I support and it is
generating deadlocks at some of customer sites. In one
case the client is seeing upwards of 40 deadlocks in a
day. Now I know the app needs to be dealt with, but that
is a long process as we have about 100 clients live and
are working on upgrades and patches. What I want to know
is, is there anything on the server side I can do to
mitigate the deadlocks? Can I allow the operation to re-
try more and thus hope one of the processes completes
before killing a process is needed? Basically, does
anyone have any thoughts? Could I pad rows in the table
to cause one row per page, thus hopefully a page lock is
actually a row lock and thus causing fewer deadlocks, if
they are table based most often?
I'm a bit desperate.
Thanks.Matt
Here are a couple of articles that might help
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;224453
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;271509
Regards
John

Monday, March 19, 2012

Deadlock isn't logging SQL statements

Hi,
I'm running SQL 2005 SP1 and we're getting some deadlocks. There is nothing
written to the event log. I've turned on 1204 and the log is showing the
deadlock however again, no SQL statements. I see this in the SQL Server log:
Log Viewer could not read information for this log entry. Cause: Data is
Null. This method or property cannot be called on Null values.. Content:.
I've also tried profiling deadlock and deadlock chain events and I can't get
the SQL still. Anyone tell me what I'm doing wrong?
ThanksHi
http://blogs.msdn.com/bartd/archive/2006/09/09/747119.aspx
http://blogs.msdn.com/bartd/archive/2006/09/25/770928.aspx
"sqlboy2000" <sqlboy2000@.discussions.microsoft.com> wrote in message
news:03FDEDA3-935F-458F-81AA-9489BAB1C2B5@.microsoft.com...
> Hi,
> I'm running SQL 2005 SP1 and we're getting some deadlocks. There is
> nothing
> written to the event log. I've turned on 1204 and the log is showing the
> deadlock however again, no SQL statements. I see this in the SQL Server
> log:
> Log Viewer could not read information for this log entry. Cause: Data is
> Null. This method or property cannot be called on Null values.. Content:.
> I've also tried profiling deadlock and deadlock chain events and I can't
> get
> the SQL still. Anyone tell me what I'm doing wrong?
> Thanks

Deadlock info

Hello,
Does the deadlock information automatically gets written to
the Sql errorlog or do we have enable traces 3604&1204,if we
enable does these flags degrade any performance or does it uses resorces
on the sql server machine.(Anything noticeable)
Thanks in advance.
Hi,
You have to turn on the trace flags so that deadlock victim info is dumped
into the errorlog with more details.DBCC TRACEON will turn the flag on for
that connection and DBCC TRACEOFF will turn it off.I have only used them for
a short period of time, so the performance degradation , if any, was hardly
noticeable.
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"sc" <anonymous@.discussions.microsoft.com> wrote in message
news:C8E78861-6B34-4AEE-97CC-D6ADC30F7DD3@.microsoft.com...
> Hello,
> Does the deadlock information automatically gets written to
> the Sql errorlog or do we have enable traces 3604&1204,if we
> enable does these flags degrade any performance or does it uses resorces
> on the sql server machine.(Anything noticeable)
> Thanks in advance.
>
|||Hi,
No, By default the trace flags are not enabled.
Enabling this trace flag for all users will definitely degrade performance .
But obviously during problem situation you have enable
it for analysis purpose.
Thanks
Hari
MCDBA
"sc" <anonymous@.discussions.microsoft.com> wrote in message
news:C8E78861-6B34-4AEE-97CC-D6ADC30F7DD3@.microsoft.com...
> Hello,
> Does the deadlock information automatically gets written to
> the Sql errorlog or do we have enable traces 3604&1204,if we
> enable does these flags degrade any performance or does it uses resorces
> on the sql server machine.(Anything noticeable)
> Thanks in advance.
>

Deadlock info

Hello,
Does the deadlock information automatically gets written to
the Sql errorlog or do we have enable traces 3604&1204,if we
enable does these flags degrade any performance or does it uses resorces
on the sql server machine.(Anything noticeable)
Thanks in advance.Hi,
You have to turn on the trace flags so that deadlock victim info is dumped
into the errorlog with more details.DBCC TRACEON will turn the flag on for
that connection and DBCC TRACEOFF will turn it off.I have only used them for
a short period of time, so the performance degradation , if any, was hardly
noticeable.
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"sc" <anonymous@.discussions.microsoft.com> wrote in message
news:C8E78861-6B34-4AEE-97CC-D6ADC30F7DD3@.microsoft.com...
> Hello,
> Does the deadlock information automatically gets written to
> the Sql errorlog or do we have enable traces 3604&1204,if we
> enable does these flags degrade any performance or does it uses resorces
> on the sql server machine.(Anything noticeable)
> Thanks in advance.
>|||Hi,
No, By default the trace flags are not enabled.
Enabling this trace flag for all users will definitely degrade performance .
But obviously during problem situation you have enable
it for analysis purpose.
Thanks
Hari
MCDBA
"sc" <anonymous@.discussions.microsoft.com> wrote in message
news:C8E78861-6B34-4AEE-97CC-D6ADC30F7DD3@.microsoft.com...
> Hello,
> Does the deadlock information automatically gets written to
> the Sql errorlog or do we have enable traces 3604&1204,if we
> enable does these flags degrade any performance or does it uses resorces
> on the sql server machine.(Anything noticeable)
> Thanks in advance.
>

Thursday, March 8, 2012

DDL via DAO: Possible?

We are converting our database from Jet to SQLServer Express. We have a general-purpose database extract/import/management utility, written in VC++, that uses DAO to access and manipulate the database. This utility has grown over the years to include a wide range of functionality, which it would be time-consuming to rewrite.

I've been been able to tweak it to successfully connect to SQLServer, select and update data.

I have NOT been able to find a way to issue DDL, such as ALTER TABLE, etc.

The steps that I am following are:

m_pCDRDatabase = new CDaoDatabase;

m_pCDRDatabase->Open ("",FALSE, FALSE,
"ODBC;"
"PROVIDER=MSDASQL;"
"DSN=DSN1;"
"Database=Current_DB;"
"Uid=user1;"
"Pwd=pwd1;"

m_pCDRQueryDef = new CDaoQueryDef(m_pCDRDatabase);
m_pCDRQueryDef->Create("","DROP TABLE [temp]");
m_pCDRQueryDef->Execute(dbSQLPassThrough);
(I have also tried the dbSeeChanges and dbExecDirect options)

The ->Execute call gives me "Cannot perform this operation.", with an error code of 0x800a0bd8.

I've tried searching MS support, and the web in general, without success.
Does anyone know if it is possible to what I am attempting, and if so, how.

Thanks a lot.

Joe

I don't believe it is using DAO and ODBC based on the Microsoft response to "Problem to connect Access 2003 to SQL Server 2005 Express" - you will have to resort to Visual Studio or the SQL Server Management Studio Express tool. This is conjecture on my part, but I believe that the security enhancements in 2005 are probably one of the major reasons that this won't work.