473,480 Members | 3,017 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using aba_lockinfo in a loop

Erland Sommarskog's procedure aba_lockinfo provides very valuable
information when trying to sort out locking and blocking problems.

However is only provides a snapshot in time.

Is it possible to have this run continuously for a period of time? or
possibly at set intervals, say every minute?

If so, how would one set it up?

Aug 18 '06 #1
4 2028
On alternative would be a watifor loop. Here is an example using a
five second delay over one minute.

declare @t datetime
set @t = dateadd(second,60,getdate())

WHILE getdate() <= @t
BEGIN
--do something here
select getdate()
waitfor delay '00:00:05'
END

Roy Harvey
Beacon Falls, Ct

On 18 Aug 2006 02:59:45 -0700, "Jim Devenish"
<in***************@foobox.comwrote:
>Erland Sommarskog's procedure aba_lockinfo provides very valuable
information when trying to sort out locking and blocking problems.

However is only provides a snapshot in time.

Is it possible to have this run continuously for a period of time? or
possibly at set intervals, say every minute?

If so, how would one set it up?
Aug 18 '06 #2
Jim Devenish (in***************@foobox.com) writes:
Erland Sommarskog's procedure aba_lockinfo provides very valuable
information when trying to sort out locking and blocking problems.

However is only provides a snapshot in time.

Is it possible to have this run continuously for a period of time? or
possibly at set intervals, say every minute?

If so, how would one set it up?
You could run it from SQL Server Agent. When you set up the job step, there
is an Advanced tab where you can redirect output to a file, and you can opt
to append to an existing file.

I would however not recommend you do this for any longer period of time in
a production environment. If system is already under load, and there are a
lot processes and lot of locks, the procedure itself takes some resources.

(But I recall that I did precisely this, ran aba_lockinfo once a minute at
one of our customers for a day or two, back in the days of SQL 6.5, and I
was able to find several flaws in our product. In fact some of the blocking
situations were unbelivable. In the lvl column which displays how many you
are waiting for, I saw the number 15!)
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 18 '06 #3
Thanks to both of you. I will give it a try.

May be back for more detailed info if I get stuck

Jim

Aug 18 '06 #4
Thanks. I have successfully set up a trial with SQL Server Agent -
every minute for 5 minutes. Works well. Now for the real thing.

Jim

Erland Sommarskog wrote:
>
You could run it from SQL Server Agent. When you set up the job step, there
is an Advanced tab where you can redirect output to a file, and you can opt
to append to an existing file.
Aug 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1937
by: Carlos Ribeiro | last post by:
As a side track of my latest investigations, I began to rely heavily on generators for some stuff where I would previsouly use a more conventional approach. Whenever I need to process a list, I'm...
3
23991
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
6546
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
8
3970
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE(...
5
5958
by: John Dumais | last post by:
Hello, I have been trying to figure out how to write an array of doubles (in this specific case) to a binary stream without using a loop. What I have been doing is... foreach(double d in...
9
3062
by: George McCullen | last post by:
I have an Outlook 2003 using Exchange Server 2003 Public Contacts Folder containing 20,000 Contacts. I am writing a VB .Net 2003 program that loops through all the contacts in a "for each oCt in...
17
3031
by: John Salerno | last post by:
I'm reading Text Processing in Python right now and I came across a comment that is helping me to see for loops in a new light. I think because I'm used to the C-style for loop where you create a...
29
5052
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
3
33331
by: Akira | last post by:
I noticed that using foreach is much slower than using for-loop, so I want to change our current code from foreach to for-loop. But I can't figure out how. Could someone help me please? Current...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7060
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7022
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4501
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.