SQLServer的tempdb 转移到其他的位置
1.stop sqlserver
2.copy tempdb files(mdf/ldf) to new folder
3.restart sqlserver
4.exe sql:
USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\tempdb\tempdb.mdf');
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'E:\tempdb\templog.ldf');
GO
5.stop sqlserver
6.delete old files
7.restart sqlserver
例:
USE master; GO ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'G:\SQLServerDB\tempdb.mdf'); GO ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'G:\SQLServerDB\templog.ldf'); GO