Solved

tempdb log filled error

Posted on 2007-11-19
5
249 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS 2012 r2 - Parm Drop Down has Date/Time 12 33
Run SQL Server Proc from Access 11 31
Update a text value in another table 10 40
Sql Query 6 67
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

778 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