Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

tempdb log filled error

Posted on 2007-11-19
5
Medium Priority
?
256 Views
Last Modified: 2009-12-16
This is sql 2000..
I ran a script on a client database to update some fields. The script joins 2 tables and sums up a column from TB2 and updates TB1.

One table has 1786967 records and the other one has 1845936 records. The update took a long time to run, then gave 2 errors: one was deadlock, the other was tempdb transaction log is full error.

I ended up adding another clause to narrow down the resultset but dont want to do that in production.

tempdb's ldf file is 6912KB and the mdf is 284288KB. Doesnt seem large. Do I need to shrink the ldf file?
0
Comment
Question by:Camillia
5 Comments
 
LVL 6

Assisted Solution

by:wshark83
wshark83 earned 400 total points
ID: 20314820
you can either shrink the file or truncate the log file for both your database and tempdb
0
 
LVL 31

Assisted Solution

by:James Murrell
James Murrell earned 400 total points
ID: 20314969
clear the tempDB space there are several  methods.
http://www.support.microsoft.com/?id=307487
0
 
LVL 7

Author Comment

by:Camillia
ID: 20316322
how could tempdb's tlog grow when it's that small and it's on Simple recovery??
0
 
LVL 25

Accepted Solution

by:
imitchie earned 1200 total points
ID: 20318597
to perform your update to TB1, sql server has to first process your sums from TB2. this work is done in the tempdb, and because your update is SO intensive (sum a big table, hold results, update other big table) - the whole thing has to
1, be done in an implicit transaction (nothing can touch tb1 or tb2 while it is happening)
2, causes a major expansion of tempdb, even if only temporarily

you should consider
1, temporarily increasing tempdb allocation to insane levels (not the initial, just the max size). you can shrink it back down when update is done; and
2, doing it at a time when no one's on the system!
note: you may still blow the log for the database in use

another option is to break your updates into manageable chunks and perform a series of smaller updates
0
 
LVL 31

Expert Comment

by:James Murrell
ID: 20328328
Thanks
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

916 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