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!

Safe way to move the TempDB

Status
Not open for further replies.

jeffmoore64

Programmer
Mar 23, 2005
207
US
What is the SOP for moving my tempdb. I want to place it on a different drive.
Can I do this with out restarting SQL Server?
Version is sqlsrv 2000

TIA
Jeff
 
If you want to move the tempdb you have to run the ALTER database command.

Code:
use master
go
Alter database tempdb modify file (name = tempdev, filename = 'D:\programs\mssql\data\tempdb.mdf')--your path
go
Alter database tempdb modify file (name = templog, filename = 'D:\programs\mssql\data\templog.ldf')--your path
Go
However, you have no choice but to restart the instance for this to take effect.



- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
You will have to restart SQL server services to move the tempdb, and you can use this:
Code:
use master
go
Alter database tempdb modify file (name = tempdev, filename = 'E:\Sqldata\tempdb.mdf')
GO
Alter database tempdb modify file (name = templog, filename = 'E:\Sqldata\templog.ldf')
GO

from this article:
I hope this helps

AL Almeida
Senior DBA
"May all those that come behind us, find us faithfull"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top