0% found this document useful (0 votes)
32 views2 pages

TEMPDB File Movement - 05MAR15

This document provides steps to move the tempdb database files to a new location. It involves: 1) Checking the current location of the tempdb files, 2) Using ALTER DATABASE to modify the file paths, 3) Restarting SQL Server, 4) Verifying the files moved correctly, and 5) Deleting the old tempdb files.

Uploaded by

pari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

TEMPDB File Movement - 05MAR15

This document provides steps to move the tempdb database files to a new location. It involves: 1) Checking the current location of the tempdb files, 2) Using ALTER DATABASE to modify the file paths, 3) Restarting SQL Server, 4) Verifying the files moved correctly, and 5) Deleting the old tempdb files.

Uploaded by

pari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

TEMPDB file Movement

STEP 1.
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

STEP 2.
Change the location of each file by using ALTER DATABASE.
USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'I:\SQLData\tempdb.mdf');
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'I:\SQLLog\templog.ldf');
GO

STEP 3.
Stop and restart the instance of SQL Server.

STEP 4.
Verify the file change.

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files
WHERE database_id = DB_ID(N'tempdb');

STEP 5.
Delete the tempdb.mdf and templog.ldf files from the original location.

You might also like