Welcome
Login  |  Register
Monday, January 05, 2009
  Search
You are here:Knowledge Base
 
 
 

 Please Register or login to view our private forums, it is free!!

Subject: Change tempdb location
Prev Next
You are not authorized to post a reply.

Author Messages
cmuenchUser is Offline
Posts:59

04/27/2007 9:40 AM  
#  Determine the logical file names of the tempdb database and their current location on the disk.

SELECT name, physical_name AS CurrentLocation
FROM sys.master_files
WHERE database_id = DB_ID(N'tempdb');
GO


# Change the location of each file by using ALTER DATABASE.

USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf');
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'F:\SQLLog\templog.ldf');
GO


# Stop and restart the instance of SQL Server.
# Verify the file change.

SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'tempdb');


# Delete the tempdb.mdf and templog.ldf files from the original location.
You are not authorized to post a reply.
Forums > Knowledge Base Systems > MSSQL > Change tempdb location



ActiveForums 3.7
 
Copyright 2006-7 Vigilant Support