question

ashok2012 avatar image
ashok2012 asked

Tempdb 1 MDF file and 3 LDF file Can we get same file after server restart?

Hi Usually Temp db have 1 MDF file and 1 LDF file. My Question is If User added 2 LDF file then 1 MDF File and 3 LDF File in SQL Server So whether After system Restarted User 2 added LDF files existing or only default 1 MDF file and 1 LDF File would be there in SQL Server?
tempdbtempdbfiles
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nidheesh.r.pillai avatar image
nidheesh.r.pillai answered
If you are asking whether the files (.mdf and .ldf [1,2,3....n]) will be present physically on disk, then in my opinion, answer is yes. But since this is for tempDB that you specifically ask, the file contents wont be the same in both files(.mdf and .ldf), as it was before system was restarted, as tempDB will be built from scratch post such an event. Thus, If you ask "Can we get same file (for tempDB) after server restart?" - Answer is no.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Wimbush avatar image
David Wimbush answered
We have multiple tempdb data files and they certainly get recreated that way after a restart. I don't know about log files as we have only one. As far as I can see, there's no benefit in having more than one log file on a database unless you need more than the maximum file size ( see http://www.sqlservercentral.com/Forums/Topic1177597-1550-1.aspx).
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.