SQL Server tempdb 数据库位置迁移

时间:2022-03-10 16:22:26

SQL Server tempdb 数据库位置迁移


--查看物理位置
SELECT
name, physical_name
FROM sys.master_files
WHERE database_id = DB_ID('tempdb');


--修改路径
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'D:\DataBaseNew\tempdb.mdf');

ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'D:\DataBaseNew\templog.ldf');

--重启数据库