Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 database backup error

Author  Topic 

h0mer
Starting Member

3 Posts

Posted - 2006-04-25 : 12:35:11
I have an ASPNET webform to manage sql express 2005 backups.
If i test the application with the debugger and click the button to made a backup, everything works ok and the backup is created inside my web application folder. When i run the web app under IIS, if I try to do the backup i recieve the following error:

Server Error in '/test' Application.
--------------------------------------------------------------------------------

User does not have permission to perform this action.
User does not have permission to perform this action.
Processed 416 pages for database 'test', file 'test' on file 5.
Processed 3 pages for database 'test', file 'test_log' on file 5.
BACKUP DATABASE successfully processed 419 pages in 0.754 seconds (4.543 MB/sec).

I have included the <localmachine>\ASPNET user in my database with
schema 'dbo' and 'db_owner' permission. I have also change the security directives of the folder where the backup is going to be saved (write permission,creation,etc..) but it doesn´t work.


It seems as if the ASPNET user have not enough permissions to do the backup operation
Any Idea??

Kristen
Test

22859 Posts

Posted - 2006-04-25 : 14:26:51
db_owner should be enough, you could add db_backupoperator and see if that helps.

Its not clear from your message which operation produced the "User does not have permission to perform this action" - particularly as you also got "BACKUP DATABASE successfully processed ..."

You probably need to output some debug info for the operation being performed so you can see the errors messages intermingled in it.

Kristen
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-25 : 21:25:57
look into your iis settings, if you are using windows authentication for the backup,
my guess is this user is the anonymous account

you can also check under sysprocessess (current activity monitor), what account is running the backup

HTH

--------------------
keeping it simple...
Go to Top of Page

h0mer
Starting Member

3 Posts

Posted - 2006-04-26 : 07:55:36

HI, I have found the error!

To do the BACKUP, the <local_machine>\ASPNET account needs diskadmin role permission (because i use sp_dropdevice and sp_addumpdevice)

(TSQL)
-> EXEC sp_addsrvrolemember '<local_machine>\ASPNET', 'diskadmin'

To do the restore I need dbcreator server role

(TSQL)
-> EXEC sp_addsrvrolemember '<local_machine>\ASPNET', 'dbcreator'


Hope this help anyone with the same problem!

Thanks
Go to Top of Page
   

- Advertisement -