Solved

SQL server tempdb database

Posted on 2013-02-06
5
388 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
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.
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.
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.

758 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

20 Experts available now in Live!

Get 1:1 Help Now