johnpalmer: (Default)
[personal profile] johnpalmer
If, for some reason, your SQL Server is not starting, due to an inability to create TempDB on a particular disk, here's what you should do.

Start SQL Server in minimal mode.

That's (from a command prompt):

sqlservr.exe -f

(Note: this is "minimal configuration mode", which includes putting the server in single user mode. -m is the switch for ordinary single user mode. But -f only allows one user to connect, so make sure that no one else even contemplates attaching to it. Use of the LART or, for hard cases, a cutlass, can help here.)

Then, open a new command window, connect via SQLCMD.EXE and key in

ALTER DATABASE TEMPDB MODIFY FILE(NAME=TEMPDEV,filename='(a path and filename)')
GO

ALTER DATABASE TEMPDB MODIFY FILE(NAME=TEMPLOG,filename='(a path and filename)')
GO
-- the default filenames are tempdb.mdf and templog.ldf. Use them, or make sure everyone knows
-- you didn't, and knows what you used. It's easier just to use the defaults.

This will set SQL to create TEMPDB on the specified disk.

Cycle SQL. Everything should be fine... or, at least, TempDB should now be set to be created in a location where it can be created.

Don't do anything else.

(Unless, of course, you know of another method of setting the tempdb location safely. In which case, sure, you can do that, but you probably know darn well why I'm saying "don't do anything else".)

Profile

johnpalmer: (Default)
johnpalmer

June 2025

S M T W T F S
1234567
89 1011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 15th, 2025 10:39 pm
Powered by Dreamwidth Studios