Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Restore database fails with '5 access is denied' windows 2008 r2 Expand / Collapse
Author
Message
Posted Tuesday, October 2, 2012 9:10 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 14, 2014 7:47 AM
Points: 25, Visits: 108
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
Post #1367111
Posted Tuesday, October 2, 2012 9:28 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, November 21, 2014 7:57 AM
Points: 80, Visits: 425
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.
Post #1367118
Posted Tuesday, October 2, 2012 9:53 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 14, 2014 7:47 AM
Points: 25, Visits: 108
cphite thank you for your reply,

The service is running, but how do you tell if it has access to a folder?
Post #1367136
Posted Tuesday, October 2, 2012 10:22 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, April 30, 2014 5:00 AM
Points: 150, Visits: 3,164
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.
Post #1367158
Posted Wednesday, October 3, 2012 10:52 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, November 21, 2014 7:57 AM
Points: 80, Visits: 425
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?
Post #1367859
Posted Wednesday, October 3, 2012 11:20 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 14, 2014 7:47 AM
Points: 25, Visits: 108
Thank you Cphite that worked perfectly

George
Post #1367875
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse