Solved

tempdb log filled error

Posted on 2007-11-19
5
250 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 100 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 100 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 300 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

828 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