Solved

tempdb size

Posted on 2006-07-04
13
400 Views
Last Modified: 2008-03-10
My tempdb database has suddendly jumped to a huge 36GB. What's the best way of clearing it while user databases are being connected to by users (if possible)?
0
Comment
Question by:PeterErhard
[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
  • 4
  • 3
  • +1
13 Comments
 
LVL 12

Assisted Solution

by:Einstine98
Einstine98 earned 100 total points
ID: 17039129
can you afford a two minutes outage,  restarting the service will clear it off and it's the easiest way of doing it...
0
 
LVL 5

Accepted Solution

by:
CIC Admin earned 300 total points
ID: 17039134
Could just be the log file.  

This thread should help :

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21387098.html

You will probably need to use DBCC SHRINGFILE

Good Luck.
0
 

Author Comment

by:PeterErhard
ID: 17039869
Can I run DBCC SHRINGFILE while users are connected to the database or will it cause problems?
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 100 total points
ID: 17039920
PeterErhard,
> Can I run DBCC SHRINGFILE while users are connected to the database or
> will it cause problems?
NO, it wont ..

FROM BOL

"The database being shrunk does not have to be in single-user mode; other users can be working in the database when the file is shrunk. You do not have to run SQL Server in single-user mode to shrink the system databases. "

0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17039927
But the only thing to be noted that, the DBCC SHRINKFILE will take too musch time, So it is better to use it with 'WITH TRUNCATE_ONLY' in this case
0
 

Author Comment

by:PeterErhard
ID: 17039963
Are you suggesting I just run this:

BACKUP LOG tempdb WITH TRUNCATE_ONLY

which will clear it, and won't cause any problems to logged on users?
0
 
LVL 12

Expert Comment

by:Einstine98
ID: 17039978
DBCC Shrinkfile has truncateonly option
0
 
LVL 12

Expert Comment

by:Einstine98
ID: 17039981
try :

DBCC SHRINKFILE (TempDev, 100, TruncateONly)
0
 

Author Comment

by:PeterErhard
ID: 17040028
I ran:

DBCC SHRINKFILE (TempDev, 100, TruncateONly)

but it only reduced the size of the tempdb.mdf file by 200MB.
0
 
LVL 12

Expert Comment

by:Einstine98
ID: 17040045
Try

DBCC SHRINKFILE (TempDev, , TruncateONly)
DBCC SHRINKFILE (TempLog, , TruncateONly)

if it doesn't work... you're better off having the 2 min. outage... and restarting the service.
0
 

Author Comment

by:PeterErhard
ID: 17040096
I ran:

DBCC SHRINKFILE (templog, 1000)

and it worked sucessfully :)
0
 
LVL 12

Expert Comment

by:Einstine98
ID: 17040117
Cool...
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17040238
Hey Peter,

Thanks for the Grade 'B'

Please re-read the EE Guidelines regarding grading Standards at:

What's the right grade to give?
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi73

And in particular this section:

<quote>
C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.
Remember, the Expert helping you today is probably going to be helping you next time you post a question. Give them a fair chance to earn an 'Excellent!' grade and they'll provide you with some amazing support. It's also true that a "C" is the lowest grade you can give, and the Experts know that -- so use it judiciously.

Only the Moderators and Page Editors have the choice to give a D grade. Beyond that, in a practical sense, the grading guidelines have "softened" a bit over the last year or two; one might expect that the majority of grades would be Bs (a standard "bell" curve), but the fact is that the culture of the site has caused there to be an inordinately high percentage of As. The Moderators have been instructed to ensure that the As they award are actually "Excellent" answers. Similarly, the C grade is the lowest that can be given by a member, a fact which should be kept in mind when grading as well.

The use of a C in a vindictive manner is likely to be changed by a Moderator. You may not like the answer you get, and in some cases, and you may not like the way it is delivered, but if it is deemed to be accurate, no less than a B is an acceptable grade.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
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…

737 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