SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unable to open the physical file


Unable to open the physical file

Author
Message
jayoub
jayoub
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 6049 Visits: 730
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

Jeff
e4d4
e4d4
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5128 Visits: 3149
Error is clear "Operating system error 5: "5(Access is denied.)"." So you should again check permissions on db files, folders where files reside and give sql server account read/write. Maybe inheritance of ntfs permissions is disabled? Setting permissions when UAC is on sometimes give strange results.
jayoub
jayoub
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 6049 Visits: 730
Thank you very much for the reply.

I will check the permissions again, but I am sure i gave the SQL Server Service account full control to the folders.

Have you heard of any problems caused by SP3. Only the servers that have it installed are having the trouble.

I have not installed SP3 on that new named instance I had to install to correct the first server and it is working perfectly.

Your help is appreciated.

Jeff
GilaMonster
GilaMonster
SSC Guru
SSC Guru (926K reputation)SSC Guru (926K reputation)SSC Guru (926K reputation)SSC Guru (926K reputation)SSC Guru (926K reputation)SSC Guru (926K reputation)SSC Guru (926K reputation)SSC Guru (926K reputation)

Group: General Forum Members
Points: 926633 Visits: 48896
Definitely a permissions error. Make sure that the SQL service account has full control over folder *and files*

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (167K reputation)SSC Guru (167K reputation)SSC Guru (167K reputation)SSC Guru (167K reputation)SSC Guru (167K reputation)SSC Guru (167K reputation)SSC Guru (167K reputation)SSC Guru (167K reputation)

Group: General Forum Members
Points: 167321 Visits: 24226
Quick thought, (and in-line with other responses), when opening SSMS do "Run as Administrator"
Cool
perrywhittle@pezzar.plus.com
perrywhittle@pezzar.plus.com
SSC Guru
SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)

Group: General Forum Members
Points: 218678 Visits: 18595
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" ;-)
jayoub
jayoub
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 6049 Visits: 730
Thank you very much for the help

I fixed it this morning by chaning the service account from a local windows account to a AD domain account. Now everything is back to normal.

When a fellow dba installed SP3 on that box he had to change the Service Account from the AD Domain account to a local account. This morning I suggested we change it back and boom everything came back to normal

Not sure exactly what happened b/c the local account was fine for the last few weeks. Also on the first server I had this problem with I was using the AD domain account for the services.

Anyway, thank you very much for the help

Jeff
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search