본문 바로가기

MS SQL Server/Administration&Management

tempdb 파일 삭제하기

Remove tempdb Data Files


---------------------------

sqlcmd -S.


--적절한 크기까지 키우고

USE [master]

GO

ALTER DATABASE [tempdb] MODIFY FILE ( NAME = N'tempdev', SIZE = 1024MB )

GO

USE tempdb

GO

DBCC SHRINKFILE (N'tempdev2' , EMPTYFILE) --shrink to 3000 MB

GO

ALTER DATABASE tempdb REMOVE FILE tempdb2;

GO

DBCC SHRINKFILE (N'tempdev3' , EMPTYFILE) --shrink to 3000 MB

GO

ALTER DATABASE tempdb REMOVE FILE tempdb3;

GO

DBCC SHRINKFILE (N'tempdev4' , EMPTYFILE) --shrink to 3000 MB

GO

ALTER DATABASE tempdb REMOVE FILE tempdb4;

GO

DBCC SHRINKFILE (N'tempdev5' , EMPTYFILE) --shrink to 3000 MB

GO

ALTER DATABASE tempdb REMOVE FILE tempdb5;

GO

DBCC SHRINKFILE (N'tempdev6' , EMPTYFILE) --shrink to 3000 MB

GO

ALTER DATABASE tempdb REMOVE FILE tempdb6;

GO

DBCC SHRINKFILE (N'tempdev7' , EMPTYFILE) --shrink to 3000 MB

GO

ALTER DATABASE tempdb REMOVE FILE tempdb7;

GO

DBCC SHRINKFILE (N'tempdev8' , EMPTYFILE) --shrink to 3000 MB

GO

ALTER DATABASE tempdb REMOVE FILE tempdb8;

GO


EXIT

---------------------------