Solved

SQL 2000 locks

Posted on 2007-03-20
10
327 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
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 shrink a transaction log file down to a reasonable size.

757 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

22 Experts available now in Live!

Get 1:1 Help Now