SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Moving tempdb
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

yaron2311
Starting Member

Israel
2 Posts

Posted - 02/09/2013 :  11:29:44  Show Profile  Reply with Quote
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 tempdb
MODIFY 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 1
MODIFY FILE failed. File 'tempdb' does not exist.

The files are located in this path.

Did someone faced this issue before?

thanks for the help

Yaron



Yaron

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2067 Posts

Posted - 02/09/2013 :  11:39:25  Show Profile  Visit jackv's Homepage  Reply with Quote
Check what value you have placed next to the NAME= .

Use this query to identify the correct NAME:

use tempdb
go
select 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.ndf

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

yaron2311
Starting Member

Israel
2 Posts

Posted - 02/09/2013 :  12:05:49  Show Profile  Reply with Quote
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?

thanks

Yaron
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2067 Posts

Posted - 02/10/2013 :  01:51:12  Show Profile  Visit jackv's Homepage  Reply with Quote
Could you post the error message from Event Viewer Event Log related to this error?. There is normally some detail in the error message

Does the service account have sufficient permissions on the folder?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

ferrethouse
Constraint Violating Yak Guru

340 Posts

Posted - 02/11/2013 :  17:17:17  Show Profile  Reply with Quote
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?

thanks

Yaron



Happened to me not along ago and it was a permissions problem. SQL could not create the tempdb files in the location I specified.
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2067 Posts

Posted - 02/12/2013 :  01:42:07  Show Profile  Visit jackv's Homepage  Reply with Quote
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 cause

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000