Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restore database fails with '5 access is denied' windows 2008 r2


Restore database fails with '5 access is denied' windows 2008 r2

Author
Message
gchappell
gchappell
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 207
We have just installed SQL Server 2012 Standard edition on a Windows Server 2008 r2 Enterprise edition. While attempting to restore a database from a SQL Server 2005 backup we get the following error
System.Data.SqlClient Sql Error:: The operating System returned the error '5(Access is denied)' while attempting to 'restore container:: validate target for creation' on I:\MSSQL-DATA\MSSQL.1\mydatabase.mdf
Have not run into this before anyone have insight?

George
cphite
cphite
SSC-Enthusiastic
SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)

Group: General Forum Members
Points: 138 Visits: 650
gchappell (10/2/2012)
We have just installed SQL Server 2012 Standard edition on a Windows Server 2008 r2 Enterprise edition. While attempting to restore a database from a SQL Server 2005 backup we get the following error
System.Data.SqlClient Sql Error:: The operating System returned the error '5(Access is denied)' while attempting to 'restore container:: validate target for creation' on I:\MSSQL-DATA\MSSQL.1\mydatabase.mdf
Have not run into this before anyone have insight?

George


Make sure that the account SQL Server (the service) is running as has access to that folder.
gchappell
gchappell
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 207
cphite thank you for your reply,

The service is running, but how do you tell if it has access to a folder?
SQLArcher
SQLArcher
SSC-Enthusiastic
SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)

Group: General Forum Members
Points: 150 Visits: 3166
See the following article for access control lists in Windows Server and ensure that the service account has the correct permissions according to this.

You will find the relevant information under Service Permissions.
cphite
cphite
SSC-Enthusiastic
SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)

Group: General Forum Members
Points: 138 Visits: 650
gchappell (10/2/2012)
cphite thank you for your reply,

The service is running, but how do you tell if it has access to a folder?


Look for the column called "Log On As" for the service. That is the account the service is running as.

Next, go to the folder (in your case I:\MSSQL-DATA\MSSQL.1\) and right-click on it.

Select Properties.

Go to the Security tab.

If the "Log On As" user from your service is a user account, make sure that user account has Full Control for the folder.

If the "Log On As" user from your service is "Network Service" or "Local System" those account should already have access, but go ahead and add them and give them Full Control.

BTW, are you sure that your I:\ drive is local and not a network drive?
gchappell
gchappell
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 207
Thank you Cphite that worked perfectly

George
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