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

  • 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

  • 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.

  • cphite thank you for your reply,

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

  • 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.

  • 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?

  • Thank you Cphite that worked perfectly

    George

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

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