Determine the current location of the MDF and LDF files.
Run the ALTER DATABASE command to move the files
USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf');
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'F:\SQLLog\templog.ldf');
GO
Stop and restart the SQL Server instance
Delete the old MDF and LDF files
Run the ALTER DATABASE command to move the files
USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf');
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'F:\SQLLog\templog.ldf');
GO
Stop and restart the SQL Server instance
Delete the old MDF and LDF files
No comments:
Post a Comment