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
 SQL Server Administration (2005)
 Help with Server Agent Job Execution

Author  Topic 

capsize
Starting Member

6 Posts

Posted - 2011-11-01 : 17:05:44
Hello,

I am trying to set up a couple maintenance jobs in my sql 2005 server, however Im getting some errors.

I have a simple maintenance plan that is deleting .bak files older than 3 days


EXECUTE master.dbo.xp_delete_file 0,N'D:\DB BU',N'bak',N'2011-10-29T15:59:02',1


however when im running it i get the following error in the View History of the job subplan:

The job failed. Unable to determine if the owner [XXXXX\Administrator] of job MaintenencePlan.SubPlan_1 has server access [reason: Could not obtain information about Windows NT group/user XXXXX\Administrator',error code 0x534. [SQL State 42000] [Error 15404].

Im using the Windows Authentication login to log into SQL Server Manager, which has sysadmin priveleges.

Any thoughts on what I might be doing wrong would be appreciated.

Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-01 : 17:11:08
Change the job owner to sa.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

capsize
Starting Member

6 Posts

Posted - 2011-11-01 : 17:19:38
Thanks Tara,

That seemed to do the trick.

Can I use this method to delete other types of files on the server (ie .zip)? My server delivers downloads to customers, and I would like to delete those after X number of days as well.

Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-01 : 20:54:03
I don't really have any experience with maintenance plans. I use custom scripts to do all of my maintenance, including deleting of files.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -