?
Solved

SQL server tempdb database

Posted on 2013-02-06
5
Medium Priority
?
440 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 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

743 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