x
login about faq Site discussion (meta-askssc)

Reboot to add TempDB files?

Do I have to reboot the server or restart the instance when I add data files to tempdb?

Thanks

more ▼

asked Oct 28 '09 at 09:45 AM in Default

Tom gravatar image

Tom
23 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

No. This code runs without the need for any sort of restart.

ALTER DATABASE [tempdb]
  ADD FILE (NAME = 'testfile', FILENAME = 'D:\Databases\MSSQL10.SQL2K8\MSSQL\DATA\tempdb_extrafile.ndf') 
TO FILEGROUP [PRIMARY];

Edit -> After a little bit of extra background searching, I found this MSDN support article. That one applies to 2000 and gives some extra information on how tempdb files are used.

more ▼

answered Oct 28 '09 at 09:52 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.2k 56 63 87

Perfect !!!...only do not forget to leave the files with the same size!!

Oct 28 '09 at 10:43 AM Laerte Junior
(comments are locked)
10|1200 characters needed characters left

Matt is correct - you can add files online. I initially thought that this wasn't possible and penned my answer below!

I'm not going to delete the answer, but just wanted to clarify that changes to tempdb, such as moving the files, would require a restart.

Changes to tempDB will take affect when you restart the SQL Server service related to that instance. Whilst a server reboot will achieve this, you can simply restart the SQL Server instance.

more ▼

answered Oct 28 '09 at 09:53 AM

Kev Riley gravatar image

Kev Riley ♦♦
46.1k 38 43 69

+1 for correction :)

Oct 28 '09 at 10:07 AM Matt Whitfield ♦♦
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x42

asked: Oct 28 '09 at 09:45 AM

Seen: 3029 times

Last Updated: Oct 28 '09 at 09:45 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.