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

x
?
Solved

Estimate the Tempdb size

Posted on 2009-06-27
8
Medium Priority
?
698 Views
Last Modified: 2012-05-07
We are moving our enviornment to a new SAN. Is there any best way to calulate the estimated size for allocating tempdb size?
0
Comment
Question by:venk_r
  • 4
  • 4
8 Comments
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 24727653
<<We are moving our enviornment to a new SAN. Is there any best way to calulate the estimated size for allocating tempdb size?>>
If you already have a working TEMPDB: multiply the *highest* used space of tempdb PRIMARY filegroup t by 5 then divide that number by the total number of cores on the server to obtain the size each file .   To get that highest value of tempdb used space, you need to monitor the system during at least 2 to 3 days because the value changes all the time.

Example: if the highest value of used tempdb space in a day is 2Gb on a 4 core server then you need about 10Gb of total space  If you have 4 cores then create 4 files of 2.5Gb each and 1 file of 64K.  The 4 files should be configured to NONAUTOGROW and the last file to AUTOGROW (as a safety net in case of the first 4 is filled).

Hope this helps..
0
 
LVL 8

Author Comment

by:venk_r
ID: 24728841
Thanks for the reply.Very useful. Can you also tell me how I can montior tempdb usage?
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 24729006
<<Can you also tell me how I can montior tempdb usage?>>
You can use  dbcc showfilestats for data files and dbcc sqlperf(logspace)  for log space...
Ex:
use tempdb
go
dbcc showfilestats
then you have total used space with the following formula: (usedextents*64)/1024

run this every minute and take the highest value in the day.
 
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 750 total points
ID: 24729016
What yo can do is program a job that would run every 5 minutes that inserts the content of both dbcc showfilestats  and dbcc sqlperf(logspace)  into 2 different tables.  Once done, simply estimate the highest value of both tempdb data file and tempdb log file.
0
 
LVL 8

Author Closing Comment

by:venk_r
ID: 31597543
thanks
0
 
LVL 8

Author Comment

by:venk_r
ID: 24738109
how do I calculate the size in(mb) based on the usedextents which is output of dbcc showfilestats?
0
 
LVL 8

Author Comment

by:venk_r
ID: 24738119
And also is there any way I can just get the tempdb log using dbcc sqlperf?
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 24738233
(usedextents*64)/1024 = size in mb
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
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…

783 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