?
Solved

delete failure on backup device, Access is denied.

Posted on 2006-05-08
11
Medium Priority
?
993 Views
Last Modified: 2008-03-17
I can't figure out why I am getting an access denied error. The file does not seem to be in use.

I tried to drop my database and get this error:

 AsynchronousDiskAction::DoDeleteFile: delete failure on backup device 'C:\Program Files\Datalink\SFS\SqlServer\SFS_ISLAND_20060501.ldf'. Operating system error 5(Access is denied.).

The database is dropped from sysdatabases, but the physical files are still there.

0
Comment
Question by:brokeMyLegBiking
  • 5
  • 3
  • 3
11 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 16632599
Hi brokeMyLegBiking,
Make sure that the user has enough permission to delete the files from the physical directory

Aneesh R!
0
 
LVL 11

Expert Comment

by:SweatCoder
ID: 16632623
are you using DROP DATABASE syntax?

>> The database is dropped from sysdatabases

?? you mean dropped when "master" is current db?
0
 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 16632631
how can I check that?
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 16632650
sweatCoder, yes, master DB is current DB. I am executing the command from a VB.NET windows application.
0
 
LVL 11

Expert Comment

by:SweatCoder
ID: 16632652
per aneeshattingal, make sure the user that runs mssql has write permissions on that ldf file and on the folder.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16632675
Easiest way is to goto
C:\Program Files\Datalink\SFS\SqlServer\
try to delete the log file . watch the error message ..
0
 
LVL 11

Expert Comment

by:SweatCoder
ID: 16632742
aneeshattingal, your experiment is only worthwhile if the logged in user is the same as the user context that mssql runs under. they are often not the same. just because the logged in user can delete a file doesn't mean mssql can.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16632776
You are Right SweatCoder. If he uses the windows Authentication, then the above strategy  will work
0
 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 16632780
OK, I think we are on to something.

When I connect to my database using windows authentication, I have no problem, but when I attach using the sa login (which is what my application is using to connect to the DB) it has the problem...

hm, now I have to figure out how to grant read-write access to the sa login, for the directory:  C:\Program Files\Datalink\SFS\SqlServer\

I don't have this problem in sql Server 2005 developer edition, just express edition.

0
 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 16632793
correction : *but when I use the sa login
0
 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 16633441
Excellent!

Thanks for your help. This issue was really causing me some serious headaches.

To fix it I just have my program log in with windows authentication instead of using the sa login for any attach databse and drop databse commands.

-brokeMyLegBiking





0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question