Tuesday, August 21, 2007

Moving TempDB on SQL Server 2005

Gregg Stark on SQL Server - Move TempDB Sql Server 2005

"I recently needed to move the TempDB on my Sql Server so I looked in Books Online and my initial thought based on what it said was that there is no way that will work.  Basically it says to find where the files are, and then move them to the new location followed by an alter statement to point the database at the new location.  Well of course this didn't work because the tempdb files are in use.  After thinking about it I just decided to try to alter the master database and point it at where I wanted the tempdb files to be and then just restart since Sql Server creates the tempdb again when you restart it.  Sure enough it worked.  Here are the steps I took.

..."

I seem to remember I had this issue/question, where I needed to move the SQL2k5 TempDB. I can't remember now if I ended up doing it this way, another way or gave up... Linking it here for future reference.

No comments: