Solved

SQL server tempdb database

Posted on 2013-02-06
5
427 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
[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
  • 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ms sql and asp dates 5 42
Format Output of Select Statement 2 38
Create a Calendar table 29 43
Replace statements HTML with HTML IF 8 63
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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.

732 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