Solved

SQL 2000 locks

Posted on 2007-03-20
10
332 Views
Last Modified: 2012-05-05
we have some locks that are.  How do I find out what is causing the locks?  I used sp_lock and I get SPID, DBID, OBJID.... What do from here?  any advice?  thanks.
0
Comment
Question by:yanci1179
  • 6
  • 3
10 Comments
 
LVL 16

Expert Comment

by:rboyd56
ID: 18760125
Use select * from sysprocesses in the master database for blocking and DBID information
Use select * from sysobjects in the database for the objid

Use the value for the dbid and objid in the where clause in the query

If you have the spid you can use dbcc inputbuffer(spid number) to see what the spid is doing.
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18760128
This article has a method to monitor blocking:

http://support.microsoft.com/kb/271509
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18760178
I meant to say you get the DBID information from select * from sysdatabases not sysprocesses
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 1

Expert Comment

by:brath
ID: 18762275
In the entreprize manager, go to Management/Current activity/Process Info/

Check the process which are currently running.
Then go to locks / Process ID
select "spid correspondingprocessid"
In the right window you will have the details about the lock...

You can kill the process by opening the item in the right window.
0
 

Author Comment

by:yanci1179
ID: 18780126
How do I find out what specific script, storeproc, etc is causing the blocking?
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18780569
If you have the spid you can use dbcc inputbuffer(spid number) to see what the spid is doing.

Run this from Query Analyzer
0
 

Author Comment

by:yanci1179
ID: 18781345
thanks rboyd56, I was able to see the name of the proc.  how can i get what database it is on?
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18781532
run sp_who2 with the spid number as the parameter.

The database is listed in the output.
0
 

Author Comment

by:yanci1179
ID: 18781798
thanks so much rboyd56,

I have one more quetion for you.

I ran dbcc inputbuffer(spid number)  and I got the following info:

EventType      Parameters EventInfo                                      
-------------- ---------- ----------------------------------------------
Language Event 0          SET TRANSACTION ISOLATION LEVEL READ COMMITTED

The information is not enough to determine what object it's coming from.  Any idea on why only this info comes up and where can i get the actual name of the object.  thanks again!!
0
 
LVL 16

Accepted Solution

by:
rboyd56 earned 500 total points
ID: 18782246
dbcc input buffer just gives you the first command in the buffer. Usually it is enough. HOwever sometimes it is not.

Look at this site to see how to use some of the columns from sysprocesses to see what the actual command that is running is.

http://vyaskn.tripod.com/fn_get_sql.htm
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question