USE [master] GO ALTER DATABASE [tempdb] MODIFY FILE ( NAME = N'tempdev', SIZE = 31457280KB ) GO ALTER DATABASE [tempdb] MODIFY FILE ( NAME = N'templog', SIZE = 62914560KB ) GO USE [tempdb]; EXEC sp_helpfile;
Thứ Sáu, 9 tháng 8, 2019
[T-SQL] Sizing Database In Advance
Thứ Hai, 5 tháng 8, 2019
[T-SQL] Change Database Location
SELECT name, physical_name AS CurrentLocation, state_desc FROM sys.master_files WHERE database_id = DB_ID(N'tempdb'); GO -- Stop SQL Server -- Copy files to new location -- Start SQL Server USE master; GO ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'E:\MSSQL\DATA\tempdb.mdf'); GO ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'E:\MSSQL\DATA\templog.ldf'); GO -- Restart SQL Server -- https://docs.microsoft.com/en-us/sql/relational-databases/databases/move-system-databases?view=sql-server-2017 -- https://www.mytechmantra.com/LearnSQLServer/How-to-Move-TempDB-to-New-Drive-in-SQL-Server/
Đăng ký:
Bài đăng
(
Atom
)