Solved

SQL server tempdb database

Posted on 2013-02-06
5
392 Views
Last Modified: 2013-06-05
Hi!
I've search the web for explanation on how to increase the number of tempdb data files and I found nothing.  I'm using SQL 2012.  Can somebody explain me how to do that?

Thanks

JS
SQL-TempDB.PNG
0
Comment
Question by:polycorjsp
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 38860081
Using multiple data files reduces tempdb storage contention and yields significantly better scalability. As a general guideline, create one data file for each CPU on the server (accounting for any affinity mask settings) and then adjust the number of files up or down as necessary. However, do not create too many files because this can reduce performance and increase management overhead.I would rather create these files on separate disks and wont go above 8 files; try adding another one or 3 files and check for the contension before going further.

Note that a dual-core CPU is considered to be two CPUs.
0
 

Author Comment

by:polycorjsp
ID: 38860090
How do I creat those files?
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 38860107
you should check this

http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1230-tempdb-should-always-have-one-data-file-per-processor-core/

You can add them using an alter database statement

ALTER DATABASE tempdb
ADD FILE (NAME = tempdev2, FILENAME = 'F:\tempdb2.mdf', SIZE = 256);
ALTER DATABASE tempdb
ADD FILE (NAME = tempdev3, FILENAME = 'G:\tempdb3.mdf', SIZE = 256);
ALTER DATABASE tempdb
ADD FILE (NAME = tempdev4, FILENAME = 'h:\tempdb4.mdf', SIZE = 256);
GO
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 38863838
Aneesh,
As a general guideline, create one data file for each CPU on the server
...
http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1230-tempdb-should-always-have-one-data-file-per-processor-core/
The general guideline is start with 4 and then add as necessary.
0
 

Author Comment

by:polycorjsp
ID: 38939404
Sorry for the delay.  I will test that soon

Thanks!
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

943 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now