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 only takes a minute to sign up.
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'.
system error 5(failed to retrieve text for this error. Reason: 15105).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server,
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.
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.
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.
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
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.
RESTOREcommand you ran?
RESTORE HEADERONLYcommand, like
RESTORE HEADERONLY FROM DISK = 'C:\...\file.bak';?