--查看tempdb文件信息
use tempdb
go
sp_helpfile
go
--修改路径
use master
go
Alter database tempdb modify file (name = tempdev, filename = ‘F:\TEMPDB\tempdb.mdf‘)
go
Alter database tempdb modify file (name = templog, filename = ‘F:\TEMPDB\templog.ldf‘)
go
Alter database tempdb modify file (name = temp2, filename = ‘F:\TEMPDB\tempdb_mssql_2.mdf‘)
go
Alter database tempdb modify file (name = temp3, filename = ‘F:\TEMPDB\tempdb_mssql_3.mdf‘)
go
Alter database tempdb modify file (name = temp4, filename = ‘F:\TEMPDB\tempdb_mssql_4.mdf‘)
go
Alter database tempdb modify file (name = temp5, filename = ‘F:\TEMPDB\tempdb_mssql_5.mdf‘)
go
Alter database tempdb modify file (name = temp6, filename = ‘F:\TEMPDB\tempdb_mssql_6.mdf‘)
go
Alter database tempdb modify file (name = temp7, filename = ‘F:\TEMPDB\tempdb_mssql_7.mdf‘)
go
Alter database tempdb modify file (name = temp8, filename = ‘F:\TEMPDB\tempdb_mssql_8.mdf‘)
go
--运行完上述命令后,还需要重启实例,方能生效。
原文:https://www.cnblogs.com/wulongy/p/14744613.html