1. Take db offline
ALTER DATABASE database_name SET OFFLINE;
GO
2. Use windows explorer to move the data and log files to the new location while the database is offline
3. Change the paths to the files
ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name, FILENAME = 'new_path\os_file_name' );
GO
4. Bring db back online
ALTER DATABASE database_name SET ONLINE;
GO
5. Verify that the database is online
SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'
No comments:
Post a Comment