Solved

tempdb log filled error

Posted on 2007-11-19
5
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

734 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