Solved

SQL 2000 locks

Posted on 2007-03-20
10
328 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
 
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now