I had a maintenance request from one of my clients to move SharePoint databases to a new SAN environment from a Old Slow SAN Environment: [Old SAN = 10K RPM with RAID 5 and New SAN = 15K RPM with RAID 10]
I used ALTER DATABASE to move the Database Files.
I did a quick read through BOL and the move was done in less than 15 mins. (Hurray BOL!)
STEPS performed as per BOL were.
- SP_HELPDB SharePointDB – to get the Logical names of the Files.
- ALTER DATABASE SharepointDB SET OFFLINE
- Move the Physical Files to the New Location then perform the next Step.
- Perform the Database Move as follows using T-SQL (I move both the Log and mdf)
ALTER DATABASE SharePointDB
MODIFY FILE (Name = ‘SharepointDB’, FILENAME=’F:\Microsoft SQL Server\SharePointDB\SharepointDB.mdf’)
ALTER DATABASE SharePointDB
MODIFY FILE (Name = ‘SharepointDB_Log’, FILENAME=’E:\Microsoft SQL Server\SharePointDB\SharepointDB_Log.ldf’) - ALTER DATABASE SharepointDB SET ONLINE
- Check the Files using the following T-SQL’s
select * from sys.master_files where name like ‘share%’ OR
select * from sys.sysdatabases where name like ‘share%’
select * from sys.sysaltfiles where name like ‘share%’
and that is it.