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
 General SQL Server Forums
 New to SQL Server Administration
 Tempdb error

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2011-06-07 : 08:15:49
Hi Team,
we tried to move tempdb files to another drive, in the mean time our juniorDBA renamed some of the existing files, and we are getting the below error. now the services are not coming up. can you please advice me how can i create a new tempdb/ or how can we resolve this issue?

An unexpected file id was encountered. File id 4 was expected but 5 was read from "F:\MSSQL\TEMPDB\Tempdb_Data3.ndf". Verify that files are mapped correctly in sys.master_files. ALTER DATABASE can be used to correct the mappings.

I tried with Netstart commands, it started, but issue is not resolved. we need the tempdb to be created.

Arnav
Even you learn 1%, Learn it with 100% confidence.

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-06-07 : 09:24:45
Slap your junior and then get him to rename the files back to what they were (while SQL is stopped)

--
Gail Shaw
SQL Server MVP
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2011-06-07 : 10:39:49
as they are mor ein number, he is not able to recollect.

Arnav
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-06-07 : 11:30:28
Try copying all the files to another location (while SQL is stopped). It should be able to recreate TempDB completely.

And have a serious discussion with your junior. That's the kind of thing that you take notes while doing and pay attention to.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

ricardocr
Starting Member

1 Post

Posted - 2011-06-26 : 18:05:59
I did the same stupid thing,
I know GilaMonster I need to be more careful, but, well at least it was in a new server I was setting up.... I will be more careful and I already slapped myself

I found an easy solution since just by recreating tempdb is not enough
try doing this, from a cmd run
NET START MSSQL$instancename /f /T3608
Now you are able to connect to the studio, modify the wrong named files on the table sys.master_files and restart the service, it will work this time
Go to Top of Page
   

- Advertisement -