Blog
Projects
About
Backtrack:
Blog
›
Move SQL Server tempdb to anot…
Email this to a friend
Move SQL Server tempdb to another location
posted on May 26th 2015, at 14:17
by
lunarg
You can move the tempdb of a SQL Server instance to another location using T-SQL, but this requires a little bit of downtime: setting a new location will only take effect after a restart of the SQL Server instance.
First, retrieve the tempdb's current location and logical name:
Use tempdbGOSELECT name,filename FROM sys.sysfilesGO
This should give you two entries: one for the actual database, and one for the transaction log of tempdb. Now that we have the location and logical name, we can change it:
ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'T:\newdir\tempdb.mdf');GOALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'T:\newdir\templog.ldf');GO
Replace the p
...
read more
Send a link to this post to yourself or a friend.
Send to e-mail
:
Your name:
Your e-mail:
Captcha:
Type the letters and numbers as shown.
Not readable?
Get another
.
Information entered is solely used for sending a one-time e-mail, and is not retained and/or passed on to a third party.
Tags
computer
windows
software
vmware
microsoft
linux
exchange
hardware
network
news
mac
powershell
home
office365
msoffice
ad
server
sqlserver
dell
soaring
esx
internet
mssql
rds
sbs
events
powercli
terminalserver
virtualization
antivirus
Archive
«
‹
November 2024
›
»
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Links
-
@harkx
-
Cats & Dogs
-
Jargon-free Security Guide
Quote
«
Stripes on a tiger are hard to change.
»
The Noisettes
Contact
© 2009-2024 Black Manticore – all rights reserved
code by
lunarg
, design by
SuriAmanah
, hosted at Cats&Dogs