x

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, 2009 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, 2009 at 09:52 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.4k 61 65 87

Perfect !!!...only do not forget to leave the files with the same size!!
Oct 28, 2009 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, 2009 at 09:53 AM

Kev Riley gravatar image

Kev Riley ♦♦
53k 47 49 76

+1 for correction :)
Oct 28, 2009 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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x50

asked: Oct 28, 2009 at 09:45 AM

Seen: 4718 times

Last Updated: Sep 18, 2013 at 02:58 PM