There's a property value set on all jobs called "RETENTION_POLICY" (something w/ retention in the name). you need to set that on existing jobs and set that as the default in the property dictionary. it's in the property dictionary in the job class.
Thanks, I've done that already. It's actually called RESULTS_RETENTION_TIME, (the OOB default is 90 days) and that clearly controls which job runs remain in the database. What is happening in our database is that the detailed log messages in each job run are being deleted after 14 days, so we have 76 days of job runs without any detailed log messages. I'd like to keep the detailed messages longer than 14 days. I'm sure I read somewhere that it is possible to configure this time period, but I can't find it now.....
Sorry, I re-read your post, and I understand.. I think this is a defect, there's a hotfix for this (for 7.6 atleast), the ticket is ISS03419767 "Job run events and audit trail log younger than RETENTION_TIME can get purged by database cleanup."
Open up a support ticket and ask for this fix
All - this applies to v7.4.6, not sure about other versions...
Just to circle back for everyone's benefit, it seems the key values I was looking for are actually stored within the database itself, and here is the SQL to set the retention values at 90 days (to match the default RESULTS_RETENTION_TIME job property):
UPDATE HK_CLEANUP_PROCEDURE SET DEFAULT_RETENTION_TIME ='90' WHERE name= 'AuditTrail';
UPDATE HK_CLEANUP_PROCEDURE SET DEFAULT_RETENTION_TIME ='90' WHERE name='JobRunEvent';
Also, if you want the job runs themselves actually deleted from the database (not just marked for deletion and removed from the view in the GUI), you need to make a small configuration change via blasadmin, as follows:
blasadmin set Cleanup DatabaseCleanupFilterEnabled false
The default value is "true", and we had over 300K job runs in our production database marked for deletion over the last 2 years, but still sitting around in the job_run table...