2

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?

6
  • What is the RESTORE command you ran? Nov 11, 2013 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, 2013 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';? Nov 11, 2013 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, 2013 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. Nov 11, 2013 at 23:18

5 Answers 5

8

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.

2
1

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.

0

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.

0

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’.
-3

I has this error trying to restore a .bak file to a new server when I had forgotten to specify a name for the new database it was going to create

1
  • 3
    Are you sure you got the exact same error?
    – dezso
    Oct 9, 2015 at 10:43

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