• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

SQL 2000 locks

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
yanci1179
Asked:
yanci1179
  • 6
  • 3
1 Solution
 
rboyd56Commented:
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
 
rboyd56Commented:
This article has a method to monitor blocking:

http://support.microsoft.com/kb/271509
0
 
rboyd56Commented:
I meant to say you get the DBID information from select * from sysdatabases not sysprocesses
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
brathCommented:
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
 
yanci1179Author Commented:
How do I find out what specific script, storeproc, etc is causing the blocking?
0
 
rboyd56Commented:
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
 
yanci1179Author Commented:
thanks rboyd56, I was able to see the name of the proc.  how can i get what database it is on?
0
 
rboyd56Commented:
run sp_who2 with the spid number as the parameter.

The database is listed in the output.
0
 
yanci1179Author Commented:
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
 
rboyd56Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now