Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using SQL Server 2008. When I tried to restore backup from SQL Server Management Studio (or) using query, I got the access denied error.

Cannot open backup device 'C:\Backup\101015.bak'. Operating system error 5(Access is denied.).

I have tried both "sa" account and windows authentication. I am the administrator for the machine. But still it throws access denied. Please help me.

share|improve this question

migrated from stackoverflow.com Oct 20 '10 at 7:26

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

1  
and the programming related bit? –  Mitch Wheat Oct 20 '10 at 4:13

3 Answers 3

up vote 0 down vote accepted

Try checking the permissions and ownership on the .bak file you are trying to restore. Right click it in windows explorer.

Select Properties - Security - Advanced.

Under Owner tab make sure Administrators group is current owner, if not use "replace owner on subcontainers and objects" option.

Check permissions too.

If not sure you could try adding Administrator read,write permissions to the file. Worst case try adding "Everyone" permissions, but just to that file - you can always remove these when finished to retain proper security.

That's not the default backup location for SQL...how/where did the backup come from? Manually via Studio Management? What permissions does the C:\Backup\ folder have?

share|improve this answer
    
I moved the file to D: and it worked :) –  jaks Oct 21 '10 at 7:21

Move the file to your default sql backup location. It will be something like c:\program files\microsoft sql server\MSSQL.1\MSSQL\Backup.

Security rights for the SQL account should not be changed in most situations.

share|improve this answer
    
Initially it was in SQL Backup folder only. Since it gave problem here, I moved to c:\backup –  jaks Oct 21 '10 at 7:13

The account that the SQL Server service is running under is account that needs access to the backup file.

share|improve this answer
    
SQL server is running under NETWORK Service account. Do I need to change that to administrator? –  jaks Oct 21 '10 at 7:14

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.