Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
yaron2311
Starting Member
2 Posts |
Posted - 2013-02-09 : 11:29:44
|
Hi I'm trying to change the location of tempdb.mdf and tempdb.ldf files.i'm using the following query in order to set the new location of the files:ALTER DATABASE tempdbMODIFY FILE (NAME=N'tempdb',FILENAME='c:\Program Files (x86)\Microsoft SQL Server\MSSYARONTEMP\tempdb.mdf')and i'm getting the following error:Msg 5041, Level 16, State 1, Line 1MODIFY FILE failed. File 'tempdb' does not exist.The files are located in this path.Did someone faced this issue before?thanks for the helpYaronYaron |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2013-02-09 : 11:39:25
|
Check what value you have placed next to the NAME= . Use this query to identify the correct NAME:use tempdbgoselect fileid,name,[filename] from sys.sysfiles--the output is something like--fileid name filename--1 tempdev G:\MSSQLSERVER\MSSQL$INST1\Data\tempdb.mdf--2 templog F:\MSSQLSERVER\MSSQL$INST1\Data\templog.ldf--3 tempdev1 E:\MSSQLSERVER\MSSQL$INST1\Data\tempdev1.ndfJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
yaron2311
Starting Member
2 Posts |
Posted - 2013-02-09 : 12:05:49
|
Thanks for the help I made the changes according to the name that the query retrieved but now after stoping and starting the Data Base again i'm geting the following error:"unable to start service MSSQLSERVER on server USER-PC"I copied the mdf and ldf files to the new path.do you know why this problem happened?thanksYaron |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2013-02-10 : 01:51:12
|
Could you post the error message from Event Viewer Event Log related to this error?. There is normally some detail in the error messageDoes the service account have sufficient permissions on the folder?Jack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
ferrethouse
Constraint Violating Yak Guru
352 Posts |
Posted - 2013-02-11 : 17:17:17
|
quote: Originally posted by yaron2311 Thanks for the help I made the changes according to the name that the query retrieved but now after stoping and starting the Data Base again i'm geting the following error:"unable to start service MSSQLSERVER on server USER-PC"I copied the mdf and ldf files to the new path.do you know why this problem happened?thanksYaron
Happened to me not along ago and it was a permissions problem. SQL could not create the tempdb files in the location I specified. |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2013-02-12 : 01:42:07
|
As well as a common issue of explicit permissions on folder- I've noticed the problem suddenly appear if there are AD group changes. It's still the same ultimate effect - i.e permissions on the folder. So it's worth exploring a few different avenues for root causeJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
|
|
|