• jayoub (12/12/2014)


    I have a problem with two SQL Server 2008R2 SP3.

    I get the following error when i try to add a database or make a backup or attach a database. I did manage to attach a database at one point, but it would only work as read only.

    Unable to open the physical file "E:\Databases\databasename.mdf". Operating system error 5: "5(Access is denied.)".

    Unable to open the physical file "E:\Databases\databasenamelog.ldf". Operating system error 5: "5(Access is denied.)".

    Database 'databasename' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

    ALTER DATABASE statement failed. (Microsoft SQL Server, Error: 5120)

    I have made sure that all permissions to the database folders are fine and there are no disk problems. On one server I had to install a new named instance of SQL using the same service accounts and drives and it works fine. I have not fixed the other server yet

    The only thing in notice about the two of them is that SQL SP3 is installed. In the first server this issue occurred soon after installing the service pack. These are dev servers and dont get used every day dont know when the other server had SQL SP3 installed.

    Any help is appreciated

    Have you fixed this yet, run the PowerShell script below to check current ACLs on files and folders

    get-childitem -path "drive:\path\to\files" -recurse | get-acl

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉