Wednesday, March 7, 2012

Backups not deleted.

I am running sql server 2000 on windows 2000. i have my backups set to delete after a week. they are not deleting, can anyone tell me why this is happening?? the backups filled the hard drive.open up your scheduled job, then open up the step that executes the backups. You should see an SQL statement like "EXECUTE master.dbo.xp_sqlmaint N'-PlanName...."

Post the statement for us to review, and while you are at it make sure that in the Advanced tab of the step editor you have an output file set to record results.|||here is the step.

EXECUTE master.dbo.xp_sqlmaint N'-PlanID 88C31DB1-FC24-42E7-AE79-CF2FA5E6C26B -Rpt "D:\Program Files\Microsoft SQL Server\MSSQL\LOG\Backup MKS4.txt" -DelTxtRpt 2WEEKS -WriteHistory -VrfyBackup -BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -BkExt "BAK"'|||OK, here are a few things to try, in this order:
1) Drop the quotes around your -BkExt parameter value:
Change this: -BkExt "BAK"
...to this: -BkExt BAK
2) Specify a backup directory after your -BkUpDB parameter, like this: -BkUpDB F:\SQLBackups
3) Try changing -DelBkUps 1WEEKS to -DelBkUps 7Days

Also, I find it helpful to use the -CrBkSubDir, so that all my database backups are organized in different directories.

And again, save the output from your job to a file, so you can trap all the errors and messages that are generated.

No comments:

Post a Comment