Reputation: 449
I had a database setup with a filestream. The filestream storage was on a separate drive than the datafiles. The server was migrated to virtual, and the drive letter unknowingly changed. The database went into 'Recovery Pending' mode. I didn't realize at first what had happened, so I took it offline in hopes of bringing it back online. That didn't work. For other reasons, I couldn't change the drive letter back on the existing drive, so I added another with the original letter, copied the filestream data, but it still won't come online. The following error:
A file activation error occurred. The physical file name 'E:\SQL Data\AutoServiceATtachments\AutoService_Filestream' may be incorrect'
What should my next steps be? This is SQL Server 2012.
Upvotes: 1
Views: 525
Reputation: 449
Just for anyone who may come across this, I have figured it out. I backed up all the files, dropped the database, and then attached it again, with the following syntax:
USE [master]
GO
CREATE DATABASE [FileStreamDB] ON
( FILENAME = N'C:\FileStreamDB\FileStreamDB.mdf' ),
( FILENAME = N'C:\FileStreamDB\FileStreamDB_log.ldf' ),
FILEGROUP [FileStreamGroup] CONTAINS FILESTREAM DEFAULT
( NAME = N'FileStreamDB_FSData', FILENAME = N'C:\FileStreamDB\FileStreamData' )
FOR ATTACH
GO
Upvotes: 1