SQL Server 2008 Tempdb 数据库迁移

1.首先检查数据文件位置及名称

SELECT name,physical_name FROM sys.database_files

image

2.迁移

USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\MSSQL\tempdb.mdf');
GO


ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev02, FILENAME = 'E:\MSSQL\tempdb02.mdf');
GO


ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev03, FILENAME = 'E:\MSSQL\tempdb03.mdf');
GO


ALTER DATABASE   tempdb
MODIFY FILE (NAME = templog, FILENAME = 'E:\MSSQL\templog.ldf');
GO

 

image

语句执行成功后会提示下次重启生效。

image

image

重启后执行 SELECT name,physical_name FROM sys.database_files 验证即可。

posted @ 2015-04-22 13:09  艾阳君  阅读(437)  评论(0编辑  收藏  举报