브랜드

Impact-Company-Logo-English Black-01-177x54

슈나이더 일렉트릭 코리아 웹사이트에 방문해 주셔서 감사합니다.

슈나이더 일렉트릭 코리아 웹사이트 방문자 분들 모두 환영합니다.
		
오늘 무엇을 도와드릴까요?
How to change the location of database TempDB files Tempdb.mdf and TempLog.ldf in SQL 2008 and 2012 from default location ?

With use of SQL Server the size of database TempDB grows and logical drive C may be short of space. Default location is as shown in snapshot.

How to change the location of database TempDB files Tempdb.mdf and TempLog.ldf in SQL 2008 and 2012 from default location

To change the location take following steps.
Determine the  file names of the tempdb database and their current location on the disk.  Files used by the tempDB database is TempDB.mdf and Templog.ldf.
Use below SQL query to check the same.
SELECT name, physical_name AS Current Location
FROM sys.master_files
WHERE database_id = DB_ID(N'tempdb');
GO

Now use below SQL query in SQL server management studio to change the location of  file by using ALTER DATABASE as shown.

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

How to change the location of database TempDB files Tempdb.mdf and TempLog.ldf in SQL 2008 and 2012 from default location

Make sure to create folders for the new locations first else the SQL query will give an error.  Cross verify as below that locations get changed.

How to change the location of database TempDB files Tempdb.mdf and TempLog.ldf in SQL 2008 and 2012 from default location

Delete Tempdb.mdf and Templog.ldf files from the old location.


슈나이더 일렉트릭 Korea

자세히 알아보기
제품군
자세히 알아보기
제품군
  • 제품 문서
  • 소프트웨어 다운로드
  • 제품 선택기
  • 제품 대체 및 교체
  • 지원 및 연락처 센터
  • 영업소 검색
  • 견적 받기
  • 슈나이더 일렉트릭 커뮤니티
  • 채용
  • 회사 소개
  • 부정 행위 보고
  • 접근성
  • 뉴스룸
  • 투자자
  • Ecostruxure
  • 작업 검색
  • 블로그
  • 개인정보 취급방침
  • 쿠키 공지
  • 사용 약관
  • Change your cookie settings