Solved

SQL server tempdb database

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql server function help 15 29
Linked Server Issue with SQL2012 3 26
SQL Server 2012 r2 - Varible Table 3 24
Query to capture 5 and 9 digit zip code? 4 20
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 …
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

770 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