Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving Tempdb

Status
Not open for further replies.

NotSQL

Technical User
May 17, 2005
205
GB
Hi, Im installing sql server and am required to move tempdb from on directory to another. Can anyone supply me with any code which will enable me to do this?

Regards
Dave
 
You will have to change the path to your specified path. Also, to help with performance you should create a tempdb file for each of you CPU's. Check out the FAQ section in here for more information.

Code:
use master
go
Alter database tempdb modify file (name = tempdev, filename = 'D:\programs\mssql\data\tempdb.mdf')
go
Alter database tempdb modify file (name = templog, filename = 'D:\programs\mssql\data\templog.ldf')
Go

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Don't forget to restart the SQL Server after you tell it to move the files.

Also make sure that the folders exist before you restart the SQL Server or the SQL Server will not come online.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top