Tuesday, April 28, 2009

MOVING TEMPDB

MOVING TEMPDB FROM DEFAULT LOCATION TO REQUIRED PATH :

When installa SQL Server all system databases will be intsalled at Progra Files - Microsoft SQL Server - Data folder. But it is suggestable that move Tempdb databsae into another driver for better performance. Moving tempdb is not like normal process, Attach/Detach, Backup/Restore, it can be done in following way.

How to move tempdb

1) Find the tempdb database file details.

sp_helpdb tempdb

2)
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'C:\tempdb\tempdb2005.mdf')
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'C:\tempdb\tempdb2005.ldf')

* C:\tempdb is the new location where we want to move the tempdb files.