How to attach database configured with Filestream

  • Hi,

    I have detached a database having Filestream and then moved the mdf,ldf and filestream folder to mount points under drive G (G:\SQLDATA and G:\SQLLOGS) and trying to attach the database. But getting the below error. Please advice.

    CREATE DATABASE Test ON

    PRIMARY ( NAME = Test_data,

    FILENAME = 'G:\SQLDATA\Test.mdf'),

    FILEGROUP RBSFileStream CONTAINS FILESTREAM( NAME = RBSFilestream_Test, FILENAME = 'G:\SQLDATA\RBSFileStream')

    LOG ON (NAME = Test_log,

    FILENAME = 'G:\SQLLOGS\Test.ldf')

    FOR ATTACH

    GO

    Error:

    msg 5120, Level 16, State 101, Line 1

    Unable to open the physical file "G:\SQLDATA\RBSFileStream". Operating system error 5: "5(Access is denied.)".

  • Check the permissions on the folders. When you copied the filestream folder it may not have inherited the permissions from the SQLData folder. The service account needs permissions to all the folders.

  • I'm new to this. Just want more info. Thanks.

  • Check the permissions on the folders. When you copied the filestream folder it may not have inherited the permissions from the SQLData folder. The service account needs permissions to all the folders.

    Permissions are all same for drives. I checked by right clicked the drives and all are having same permissions.

    Error from error log:

    Error: 3633, Severity: 16, State: 1.

    2012-03-22 13:19:49.17 spid58 The operating system returned the error '2(The system cannot find the file specified.)' while attempting 'FsFileHeader::Open' on 'G:\SQLDATA\RBSFileStream' at 'stmfcb.cpp'(6583).

    2012-03-22 13:19:49.20 spid58 Error: 17204, Severity: 16, State: 1.

    2012-03-22 13:19:49.20 spid58 FCB::Open failed: Could not open file G:\SQLDATA\RBSFileStream for file number 0. OS error: 5(Access is denied.).

  • Hi Gary,

     

    I know it was a long time ago when this post has been sent, but I have the same problem now so I would like to ask if you solved the problem back then...

     

    Any help appreciated, Thanks!

    • This reply was modified 3 years, 3 months ago by  SQLer.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply