Solved

SQL 2000 locks

Posted on 2007-03-20
10
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

691 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