How to move Tempdb data and Log Files - SQL Server DBA Tutorial

In this video you will learn how to move Tempdb data and log files from current location to new location. It also demonstrates step by step process of how to find current location of Tempdb Files, How to move Tempdb Files to new location using T-SQL Script and what is required for sql server to use new tempdb file location. How to restart SQL Server Services.

Script used in the video to Move TempDB Data and Log Files

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

--Move Tempdb Files
USE master
GO
ALTER DATABASE tempdb 
MODIFY FILE (NAME = tempdev, FILENAME = 'C:\SQLSysBackup\tempdb.mdf') -- New Location DataFile
GO
ALTER DATABASE tempdb 
MODIFY FILE (NAME = templog, FILENAME = 'C:\SQLSysBackup\templog.ldf')--New Location LogFile
GO


How to move Tempdb data and Log Files - SQL Server DBA Tutorial

3 comments:

  1. nks for sharing the article, and more importantly, your personal experience mindfully using our emotions as data about our inner state and knowing when it’s better to de-escalate by taking a time out are great tools. Appreciate you reading and sharing your story since I can certainly relate and I think others can to


    https://shareit.onl/

    ReplyDelete
  2. Thanks for sharing this blog,I hope that you continue to share a lot of knowledge. ERP Software Companies

    ReplyDelete
  3. Really helpful for software section. very informative. thanks for sharing
    if you want to learn web related training with place ment ,contact us
    web design course in coimbatore
    web develoment training in coimbatore
    seo training in coimbatore

    ReplyDelete