Quantcast
Channel: SQL Server Manageability forum
Viewing all articles
Browse latest Browse all 1519

Cleanup task /xp_delete_file doesn't delete maintenance reports in SQL Server 2012 (German)

$
0
0

The cleanup Task in Maintenance Plans doesn't delete silently reports of maintenance report.

When created normally, the 2<sup>nd</sup> parameter of xp_delete_file points to the \LOG folder and when executing the plan/task, it runs successfully, but w/o deleting any txt files qualifying for deletion.

You only get a somewhat useful error message, when you call xp_delete_file with a real report file of a Maintenance Plan (and a qualifying deletion date!):

Error 22049:

Error executing xp_delete_file extended stored procedure: Specified file is not a Maintenance Plan report file.

Can anybody confirm/deny this behavior in an English installation or another language?

Notes:

- I had only a chance to test this on various German SQL Server installations. If this issue was introduced by localization it may work in an US English installation. Feedback welcome!

This scenario also fails in German SP3 for SQL 2012, but it works fine in a German SQL 2014

Steps to reproduce:

  1. Create a Maintenance Plan with a little dummy task (runtime < 1 min.) on a small DB. E.g. Running "DBCC CheckDB" w/o index on MSDB. Schedule this plan to run every minute
  2. Note that the report files will start to fill your \LOG folder after some minutes
  3. Create a 2<sup>nd</sup> Maintenance Plan with a Cleanup Task, that deletes Maintenance Plan report files from your \LOG folder, which are older than 1 hour and schedule it to run every 5 minutes
  4. Wait some hours and you'll see that no  Maintenance Plan report file gets deleted!
  5. To get error 22049, you need to change the Maintenance Plan to delete only a specific report file which is older than 1 hour

Viewing all articles
Browse latest Browse all 1519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>