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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Moving Tembdb file

Author  Topic 

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-09-29 : 13:46:17
Hi,

I was moving tempdb log file from one drive to other. I used following command:

alter database temdb
modify file(name=tempdev,
filename='d:\data\temp_log.ldf'

By mistake I wrote data file name in name=filename. I copied log file to new location. Now I cannot start sql server instance. Any help?

Thanks

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-09-29 : 14:02:44
Can you start SQL with the -f paramater?

If so, then you can re-run your alter database statement and restart (without the -f param).

http://msdn.microsoft.com/en-us/library/ms190737.aspx
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-09-29 : 15:46:20
Thanks Russell for your help. That's works.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-09-29 : 17:06:25
You're welcome. Glad to help.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-09-30 : 09:34:02
By the way, with tempdb, no need to actually move the files. Just restart MSSQL.
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-09-30 : 13:23:44
But old files will be there. I have to delete them manually. Anyhow thanks for help.
Go to Top of Page
   

- Advertisement -