Error 5 Access Is Denied While Attempting Restorecontainer Validatetargetforcreation
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies operating system error 5 access is denied sql server 2008 of this site About Us Learn more about Stack Overflow the company operating system error 5 access is denied sql server 2012 Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges operating system error 5 access is denied sql server 2014 Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: the operating system returned the error '5(failed to retrieve text for this error. reason 15105)' Sign up mssql '5(Access is denied.)' error during restoring database up vote 38 down vote favorite 8 I want to restore a database from a file (Tasks->Restore->Database; after I select from device and select file) via SQL server management studio. After that, I get this error: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'E:\Program Files\Microsoft SQL
Operating System Error 5(access Is Denied.). Backup Database Is Terminating Abnormally
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\XXXXXX.mdf'. Msg 3156, Level 16, State 8, Server XXXX, Line 2 How do I fix this problem? Is it a security error? sql-server ssms share|improve this question edited Sep 14 '14 at 21:10 asked Aug 16 '10 at 15:03 2xMax 52121335 add a comment| 8 Answers 8 active oldest votes up vote 50 down vote accepted The account that sql server is running under does not have access to the location where you have the backup file or are trying to restore the database to. You can use SQL Server Configuration Manager to find which account is used to run the SQL Server instance, and then make sure that account has full control over the .BAK file and the folder where the MDF will be restored to. share|improve this answer edited Feb 7 '13 at 16:14 Greg Bray 5,69353766 answered Aug 16 '10 at 15:07 SQLMenace 91.8k20148192 4 I changed to "Local Sytem", and it worked! –Seva Jul 17 '14 at 0:28 1 I added "NT Service\MSSQLSERVER" user to the list of "Group or user names" allowed to and it worked –slav
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring
System.data.sqlclient.sqlerror: Cannot Open Backup Device
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question create file encountered operating system error x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; nt service\mssqlserver it only takes a minute: Sign up Restoring SQL backup fails - Access is denied up vote 3 down vote favorite Solved. See my answer (but first see my second edit to the question). I'm trying to restore a http://stackoverflow.com/questions/3494407/mssql-5access-is-denied-error-during-restoring-database backup for a database from one computer on another - thereby copying the db, but I get this message: 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...'. (Microsoft.SqlServer.SmoExtended) Why is this? I can create new databases, so why not restore? Is it because it's from another computer? (I read that that's actually a usual way to copy a db so this shouldn't be the problem.) I don't have much http://stackoverflow.com/questions/16676599/restoring-sql-backup-fails-access-is-denied experience with this so don't rule out any obvious explanation. EDIT : I can 'restore' it using the administrator user account to the administrator's instance of SQL Server (I have two - one for the administrator, and one for the regular account.) but can't do it from either account to the regular user's instance of SQL Server. EDIT 2 : It seems that there are already existing files with the backup's files names (even though I changed the existing db's name). I'm working on that now (Trying, still unsuccessfully, to restore to different file names). sql-server sql-server-2012 ssms share|improve this question edited May 21 '13 at 20:26 asked May 21 '13 at 18:06 ispiro 8,7261047117 I've had failures like that in the past because of a version mismatch. Make sure your restore script and database are of the same version, if not, then check the compatibility options. –Mr Jack May 21 '13 at 18:08 1 @MrJack Thanks. But I just had the idea to try it from an administrator account and it can be done, but not to the regular user's instance of SQL Server. (See edit in the question.) –ispiro May 21 '13 at 18:16 I cannot help much with reg. user accounts though, my use of SQL Server is internal and I'm always admin. –Mr Jack May 21 '13 at 18:19 Windows or sql authentication? Same authenticati
up Recent PostsRecent Posts Popular TopicsPopular Topics Home Search Members Calendar Who's On Home » SQL Server 2005 » Backups http://www.sqlservercentral.com/Forums/Topic366456-357-1.aspx » Operating System error 5(Access is Denied) 20 posts,Page 1 of 212»» Operating System error 5(Access is Denied) Rate Topic Display Mode Topic Options Author Message Ryan WellmanRyan Wellman Posted Wednesday, May 16, 2007 10:25 AM Forum Newbie Group: General Forum Members Last Login: Wednesday, June 6, 2007 2:21 PM Points: 2, Visits: 1 I am an intern working with two SQL Server 2005 instances operating system on two Windows Server 2003. The servers are linked via crossover. I am using this setup to practice my log shipping before I move to the production databases. I am using the wizard to complete the log shipping. The primary server SQLCOM1 is to backup and restore the DB on the secondary server SQLCOM2\SQL_Data using the default folders after the restore. SQLCOM2\SQL_Data has been shared and access is denied I have permissions for most of the default SQL groups as well as a user 'connect' and the local admin. When I go to execute the log shipping it throws the following:BackupDiskFile::CreateMedia: Backup device '\\SQLCOM2\SQL_Data\AdventureWorks.bak' failed to create. Operating system error 5(Access is denied.).I am working with SQL Server 2005 Enterprise Edition SP1. (SP1 to replicate the production servers.)Additional info:I am logged in as Administrator on both machines.The Share Permissions has the following groups or user names:Administrator(SQLCOM2\Administrator)connect(SQLCOM2\connect)EveryoneNETWORKNETWORK SERVICERemote Desktop Users(SQLCOM2\Remote Desktop User)SERVICESQLServer2005MSFTEUser$SQLCOM2$MSSQLSERVERSQLServer2005MSSQLUser$SQLCOM2$MSSQLSERVERSQLServer2005AgentUser$SQLCOM2$MSSQLSERVERSYSTEMEach of these users\groups has full control permissions.Thanks for any help,Ryan Post #366456 Ryan WellmanRyan Wellman Posted Wednesday, May 16, 2007 11:24 AM Forum Newbie Group: General Forum Members Last Login: Wednesday, June 6, 2007 2:21 PM Points: 2, Visits: 1 Sweet!I changed the "log on as" to .\Administrator for SQL Server (MSSQLSERVER) and SQL Server Agent (MSSQLSERVER). In the SQL Server Configuration Manager and ran the Log Shipping wizard and all is well!Thank you very much for reading,Ryan Post #366480 Sugesh KumarSugesh Kumar Posted Monday, July 2, 2007 6:30 AM Hall of Fame Group: General Forum Members Last Login: Thursday, July 9, 2015 9:38 AM Points: 3,461, Visits: 358 OS error 5 corrspond