473,513 Members | 7,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Locking on Tempdb...

Hi Group,
I am facing a problem regarding locking. I have created a Stored
Procedure in my Database. In this Stored Procedure Temprary Tables get
created and after that values are inserted in these tables.But this
Stored Procedure is called from Java Portal. When then Stored Procedure
execute from Java end new transaction begins. So all these temporary
tables are created in tempDB and locking the entire Database.

So at the same time if another user fires the same Stored Procedure
from portal end its give the error "Lock time out". But if the prev
Stored Procedure execution gets competed before this request then no
error comes.

So is there any way from database to restrict to lock the tempDB
database????
Can you provide some valuable advice?

Thanks in advance.
Regards
Arijit Chatterjee

Jul 23 '05 #1
8 12744
(ar*****************@yahoo.co.in) writes:
I am facing a problem regarding locking. I have created a Stored
Procedure in my Database. In this Stored Procedure Temprary Tables get
created and after that values are inserted in these tables.But this
Stored Procedure is called from Java Portal. When then Stored Procedure
execute from Java end new transaction begins. So all these temporary
tables are created in tempDB and locking the entire Database.

So at the same time if another user fires the same Stored Procedure
from portal end its give the error "Lock time out". But if the prev
Stored Procedure execution gets competed before this request then no
error comes.

So is there any way from database to restrict to lock the tempDB
database????
Can you provide some valuable advice?


This sounds strange. Unless you are running SQL 6.5 that is. In 6.5
creating temp tables in transactions would block any other process
that tried to create a temp table.

But in SQL 2000, this should not happen, unless there is something
more to it. You should examine exactly what the blocked processes are
waiting for. I have a tool on my web site, that can help you do this,
http://www.sommarskog.se/sqlutil/aba_lockinfo.html.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
Hi Erland,
Thanks for your reply. Is there any way to prevent the tempdb for
making any locks on any objects.Thanks in advance. I am trying to do
R&D with the support of your product.
Regards
Arijit Chatterjee

Jul 23 '05 #3
Hi Group,
Continuation of the Problem...But I am trying to highlit is different
manner..Using Sqlserver 2000 with Service pack 3
After login When I am going to Current Activities under Management and
doing refresh it is fine.
But from my Database end under Query Analyzer I am typing these lines

begin tran t1
create table #t1 (a int)
insert into #t1 values(1)
---------But not commiting still now..
And again I am going to Current Activities under Management and doing
refresh but now it is telling
Error 1222: Lock request time out period exceeded.

Now plese guide me how to solve this..without commiting the
transaction..I can say this transaction process can take 1 hour also..
That is why it has not commited still now.. That means on that time no
one can interact with the tempDB?
Any advice is most welcome..Thanks in advance.
Regards
Arijit Chatterjee

Jul 23 '05 #4
(ar*****************@yahoo.co.in) writes:
Continuation of the Problem...But I am trying to highlit is different
manner..Using Sqlserver 2000 with Service pack 3
After login When I am going to Current Activities under Management and
doing refresh it is fine.
But from my Database end under Query Analyzer I am typing these lines

begin tran t1
create table #t1 (a int)
insert into #t1 values(1)
---------But not commiting still now..
And again I am going to Current Activities under Management and doing
refresh but now it is telling
Error 1222: Lock request time out period exceeded.
Don't use Current Activity. It tries to look up the name of the temp
table, but uses READ COMMITTED isolation level to do this, so it gets
blocked. If you use my aba_lockinfo you will not get blocked, because
I read the system tables with READ UNCOMMITTED. (Dirty reads, which in
this special case is the right level.)
Now plese guide me how to solve this..without commiting the
transaction..I can say this transaction process can take 1 hour also..
That is why it has not commited still now.. That means on that time no
one can interact with the tempDB?


That's a foregone conclusion. Special operations like Current Activity
will block. Normal usage will not.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5
Hi Erland ,
Thanks for your reply.I run your aba_lockinfo and getting the response
for there three columns as below.
Lock_Type,Owner_Type,Object

aba_lockinfo 0,0,0--Running this

S Sess NV_DAILY
Sch-M Xact tempdb.dbo.#4AC307E8
Sch-M Xact tempdb.dbo.#inputbuffer____________00010000003D
Sch-M Xact tempdb.dbo.#objects________________00010000003D
Sch-M Xact tempdb.dbo.#result_____________00010000003D
Sch-M Xact tempdb.dbo.#t1_____________________00000000003D
Sch-M Xact tempdb.dbo.DF__#result__last__4F87BD05
Sch-M Xact tempdb.dbo.PK__#result__4E9398CC
IX Xact tempdb.dbo.syscolumns
X Xact tempdb.dbo.syscolumns.ncsyscolumns
X Xact tempdb.dbo.syscolumns.syscolumns
IX Xact tempdb.dbo.syscomments
X Xact tempdb.dbo.syscomments.syscomments
IX Xact tempdb.dbo.sysdepends
IX Xact tempdb.dbo.sysindexes
X Xact tempdb.dbo.sysindexes.sysindexes
IX Xact tempdb.dbo.sysobjects
X Xact tempdb.dbo.sysobjects.ncsysobjects
X Xact tempdb.dbo.sysobjects.ncsysobjects2
X Xact tempdb.dbo.sysobjects.sysobjects
IX Xact tempdb.dbo.syspermissions
IX Xact tempdb.dbo.sysproperties
Sch-M Xact tempdb.dbo.UQ__#objects__526429B0
X Xact tempdb.MISSING?
X Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
IX Xact tempdb.MISSING?
X Xact tempdb.MISSING?
X Xact tempdb.MISSING?
X Xact tempdb.MISSING?

NV_DAILY is my Database.And after that the tempdb can't create any
#table on the same name until that procedure commits the
transaction.Any advice is acceptable.Thanks in advance.
Regards
Arijit Chatterjee

Jul 23 '05 #6
Hi Erland ,
Thanks for your reply.I run your aba_lockinfo and getting the response
for there three columns as below.
Lock_Type,Owner_Type,Object

aba_lockinfo 0,0,0--Running this

S Sess NV_DAILY
Sch-M Xact tempdb.dbo.#4AC307E8
Sch-M Xact tempdb.dbo.#inputbuffer____________00010000003D
Sch-M Xact tempdb.dbo.#objects________________00010000003D
Sch-M Xact tempdb.dbo.#result_____________00010000003D
Sch-M Xact tempdb.dbo.#t1_____________________00000000003D
Sch-M Xact tempdb.dbo.DF__#result__last__4F87BD05
Sch-M Xact tempdb.dbo.PK__#result__4E9398CC
IX Xact tempdb.dbo.syscolumns
X Xact tempdb.dbo.syscolumns.ncsyscolumns
X Xact tempdb.dbo.syscolumns.syscolumns
IX Xact tempdb.dbo.syscomments
X Xact tempdb.dbo.syscomments.syscomments
IX Xact tempdb.dbo.sysdepends
IX Xact tempdb.dbo.sysindexes
X Xact tempdb.dbo.sysindexes.sysindexes
IX Xact tempdb.dbo.sysobjects
X Xact tempdb.dbo.sysobjects.ncsysobjects
X Xact tempdb.dbo.sysobjects.ncsysobjects2
X Xact tempdb.dbo.sysobjects.sysobjects
IX Xact tempdb.dbo.syspermissions
IX Xact tempdb.dbo.sysproperties
Sch-M Xact tempdb.dbo.UQ__#objects__526429B0
X Xact tempdb.MISSING?
X Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
Sch-M Xact tempdb.MISSING?
IX Xact tempdb.MISSING?
X Xact tempdb.MISSING?
X Xact tempdb.MISSING?
X Xact tempdb.MISSING?

NV_DAILY is my Database.And after that the tempdb can't create any
#table on the same name until that procedure commits the
transaction.Any advice is acceptable.Thanks in advance.
Regards
Arijit Chatterjee

Jul 23 '05 #7
(ar*****************@yahoo.co.in) writes:
NV_DAILY is my Database.And after that the tempdb can't create any
#table on the same name until that procedure commits the
transaction.Any advice is acceptable.Thanks in advance.


Try this:

BEGIN TRANSACTION
CREATE TABLE #temp(a int NOT NULL PRIMARY KEY)

Run from two windows. This does not block on the machine I tested.

I'm sorry, but you will have to examine more in detail, why you get
blocking. Maybe there is something special in your code that gives you
blocking. But I can't sit and guess from a distance what may be.

You could post the entire output from aba_lockinfo. Please put in an
attachment, so that the lines don't get wrapped.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #8
Thanks Erland ,
Thanks for your response.
Reg
Arijit Chatterjee

Jul 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6507
by: New DB Admin | last post by:
Is it a good thing to do? what are the cons? Are there any risks? (this is an ISP database running 24 hrs) I have sql 6.5 on Win NT with 256 MB Ram (64 MB reserved for SQL Server). tempdb size is...
10
13254
by: Jay Chan | last post by:
I keep getting the following error message when I run a serie of SQL commands: Server: Msg 9002, Level 17, State 6, Line 15 The log file for database 'tempdb' is full. Back up the transaction...
3
3649
by: Deaconess | last post by:
I have shut down the SQL agent, rebooted the box and still my TEMPDB is at 4 GB plus. Is there any way to shrink it another way?
3
8279
by: tom horner | last post by:
Something strange is happening to our SQL Server DB (2000). The tempdb transaction log file continues to grow (quite slowly) for no apparent reason. We have it in simple mode, and I have tried a...
2
3702
by: Warren Wright | last post by:
Hi All, First, where can I get some questions of this sort answered? Preferably, are there good books or online guides that I can consult for these types of answers when necessary? 1. How do...
2
3877
by: Tom | last post by:
I received an error that the log in tempdb was full, but the log and data segments are set to automatically grow with no limit AND there is plenty of available space on the disk. So I don't...
3
6667
by: New MSSQL DBA | last post by:
has anyone met with this before? the setting is SQL2K with SP3 on a 2 node active-active W2K3 cluster. on one of the machine, it occasionally prompts for the following error: "The log file for...
1
7197
by: SQL Server | last post by:
Hi, The tempdb file on one of our servers grew very large and used all available disk space. This is SQL Server 2000 SP4. I have installed hotfix version 8.00.2187. I opened a profiler trace but...
2
12702
by: Thomas R. Hummel | last post by:
I was able to find a few posts on this topic, but none of them quite seemed to fit the situation, so I'm hoping that someone else might be able to help me here. I have a client who is using SQL...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.