unable to see job history for some jobs

  • Hi All,

    I am unable to see job history for some jobs. Usually, we run some maintenance jobs. for example) index maintenance and updating stats. Why it is not showing up? anything needs to be changed in SQL Agent Properties?

    1

    2

     

    Regards,

    Sam

    Attachments:
    You must be logged in to view attached files.
  • Is this on an Azure Managed instance ? You need to put temporal tables in place to have access to job history.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • on a very busy system those values will cause many jobs to be cleared within hours.

    on top of increasing those values (mainly the first one as it is the sum of ALL jobs) you may need to do manual cleaning of very frequent jobs so they don't cause the others to be dropped.

    for example jobs that run every 10 seconds likely can be deleted after 1 hour - similar for those that run every 5 mins delete them after 5 hours.

     

    a sample block that can be put on its own job

    use msdb;
    declare @cleanupdate datetime;

    -- purge specific history that contain no usefull info and runs very frequently.

    -- ******************************
    -- DBA jobs - no need to keep history for more than 1 day
    -- ******************************
    set @cleanupdate = dateadd(dd, -1, getdate());

    if exists(select 1 from msdb.dbo.sysjobs where name = 'sp_delete_backuphistory')
    begin
    exec msdb.dbo.sp_purge_jobhistory @job_name = 'sp_delete_backuphistory', @oldest_date = @cleanupdate;
    end
  • Thank you frederico. Yes, it is a busy server.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply