none
RESTORE

    Question

  • HI TO ALL,

    1. I Hav take backup in 1 server n i want to restore it in another server. i hav taken backup successfully but when i m trying to restore it in another server it shows below error. what is the sol pls rep...

         Restore of database 'SAMPLE' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)

         System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\SAMPLE.mdf'. (Microsoft.SqlServer.SmoExtended)

    THANKS IN ADVANCE.


    MUNNURU K

    Wednesday, November 06, 2013 4:06 AM

Answers

  •  System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\SAMPLE.mdf'. (Microsoft.SqlServer.SmoExtended)


    You would get a clue from the error message itself.  SQL logon account doesn't have proper permission to C:\Program files\......

    Satheesh
    My Blog



    Wednesday, November 06, 2013 4:46 AM
  • as said this is permission issue on the file system level, so where ever you restoring the files you should have R/w or full permission.

    Usually you shoudn't put the database files in the Operating system level, as OS team might can remove permissions if there is no proper security track if they dont have it so.

    Atlease you need to ensure you are part of the administrator group & this group as R/W permission or full permission on which file you are going to accesses or creating, so usually the SQL server account will have permission if initially they have set you shouldn't get issue , but check with your OS team on that & fix the issue.


    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.


    Wednesday, November 06, 2013 7:24 AM

All replies

  •  System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\SAMPLE.mdf'. (Microsoft.SqlServer.SmoExtended)


    You would get a clue from the error message itself.  SQL logon account doesn't have proper permission to C:\Program files\......

    Satheesh
    My Blog



    Wednesday, November 06, 2013 4:46 AM
  • Few things:

    1. You need to look at service account has privileges to access the folder.

    2. If the file is already being used(already created the db), then you need to map to different drive.


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Wednesday, November 06, 2013 4:47 AM
  • as said this is permission issue on the file system level, so where ever you restoring the files you should have R/w or full permission.

    Usually you shoudn't put the database files in the Operating system level, as OS team might can remove permissions if there is no proper security track if they dont have it so.

    Atlease you need to ensure you are part of the administrator group & this group as R/W permission or full permission on which file you are going to accesses or creating, so usually the SQL server account will have permission if initially they have set you shouldn't get issue , but check with your OS team on that & fix the issue.


    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.


    Wednesday, November 06, 2013 7:24 AM
  • give full access on folder.
    Friday, November 08, 2013 6:24 AM
  • You just need to check the "Relocate all files to folder" checkbox in the files pane after you've specified the database you want to restore
    Tuesday, April 08, 2014 11:47 PM