Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

In my work I made backup of database and I receive file .bak. Now I would like restore this database in my machine. But I get the following error:

Cannot open backup device 'C:\Program Files...\MSSQL10_50.SQLEXPRESS...\file.bak'.
Operating system error 5(failed to retrieve text for this error. Reason: 15105).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

Of course I searched the Internet, for example: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/805661f1-cf23-4230-ae31-d9cc16505359/cant-restore-backup-from-2005-to-2008r2?forum=sqlexpress

But all users have permissions to all folders so I'm really confused. What is the problem?

share|improve this question

migrated from stackoverflow.com Nov 12 '13 at 1:46

This question came from our site for professional and enthusiast programmers.

    
What is the RESTORE command you ran? –  Aaron Bertrand Nov 11 '13 at 23:05
    
I would like restore my database. So in Object Explorer I click right on Databases -> restore database -> mark from device and then I find my file *.bak and occur these problem. –  Tomek Nov 11 '13 at 23:10
2  
So what happens when you stop using the UI/crutch and write a RESTORE HEADERONLY command, like RESTORE HEADERONLY FROM DISK = 'C:\...\file.bak';? –  Aaron Bertrand Nov 11 '13 at 23:10
    
The same problem: Msg 3201, Level 16, State 2, Line 1 Cannot open backup device 'C:\...\file.bak'. Operating system error 5(failed to retrieve text for this error. Reason: 15105). Msg 3013, Level 16, State 1, Line 1 RESTORE HEADERONLY is terminating abnormally. –  Tomek Nov 11 '13 at 23:14
3  
Have you tried moving it to a different location? Note that the SQL Server service has to have explicit permissions on the folder (not just you, the user executing the command), and if that folder does not represent the same instance where you're trying to restore, it's unlikely the service has access to the folder. Just for kicks, try moving the .bak file to the current instance's data or log folder, where SQL Server will certainly have adequate permissions. You might also want to start arranging to get another backup, as this one could also be corrupt. –  Aaron Bertrand Nov 11 '13 at 23:18

4 Answers 4

Sounds like a permissions error is being masked. You have to remember that the user that needs access to the folder where the backup resides (and where you restore the backup, if using WITH MOVE explicitly) is the SQL Server service account, not regular users.

If the folder listed in the error message does not represent the same instance where you're trying to restore, it's unlikely the service has access to the folder. Try moving the .bak file to the current instance's data or log folder, where SQL Server will certainly have adequate permissions.

share|improve this answer
1  
Yep, it's definitely permissions, operating system error 5 is access denied, useful link for these error codes: msdn.microsoft.com/en-us/library/windows/desktop/… –  steoleary Nov 12 '13 at 9:41

Definitely a location of the backup file problem, I've had the problem before and it was down to the fact I didn't have access to the file where the database backup was located, or where the database files were going to be restored to.

share|improve this answer

This is due to permission error i.e., SQL server doesn't have access to the backup file. It doesn't have anything to do with user permissions of backup file in Windows machines. This can be due to many reasons. For instance, if you copied the backup file from another computer, your computer may block the file due to security reasons. It can be fixed in windows 7 by selecting the property of the backup file and clicking the unblock button in it.

share|improve this answer

Here some procedures which helps you to resolve your problem please go through it

  • Free the drive volume to enable expansion of SQL backup files.
  • Run defragmentation process and analyze the level for all volumes to ensure that it is more than 15%.
  • You can also follow the under mentioned workaround to rectify SQL Error 15105 issue:
  • Go to the location on shared network where the original folder locates.
  • Right click on the folder and select “Sharing and Security” option.
  • In the “Sharing” tab, click on “Permissions”
  • Next, assign “Full Access” privilege to target account for which backup is generated and if you are not concerned about security, you may assign “Full Access” to “EVERYONE” for a particular period of time. Once the backup process is completed, you can change\ modify the assigned permissions.
  • Once you are done with applying permissions and privileges, click on ‘Apply’ and then ‘OK’.
  • Afterwards, click on the “Security” tab and add the specified account to whom full access permissions are granted and assign appropriate privileges to the accounts.
  • Click on ‘Apply’ and further select ‘OK’.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.