question

jhunu avatar image
jhunu asked

No job history .

No job history . can u pls tell us where the history is and how it deleted . and who delete it . In my jobs history all the job history is empty. wanted to know why is it so . Have checked is their any job which delete the history from job. Kindly history
sql-agentjob-history
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Wilfred van Dijk avatar image
Wilfred van Dijk answered
Do you keep track of your databases size? In that case, you'll know rougly when it happened. loghistory is stored in a table in the MSDB database (sysjobhistory). Depending on auditing settings you can see who executed the "truncate table sysjobhistory", but I assume that's theoretical. Note: you can also delete log history with some stored procedures provided by SQL. Check also "SQL Server Agent" -> Properties -> History to see your history settings.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jhunu avatar image jhunu commented ·
fatherjack , thanks for your revert. I have checked jobhistory and in that it shows only the history for the day the job executed.I have also seen the agent > properties > history > . Their the delete job histort is unchecked. I have see that the case is same for ll the jobs . All the history is deleted except the the current day it was executed. I wanted to know how this is happening , since we dont have any jobs which delete the history , neither we have any maintenence plan which execute the "delete history " step. On daily basis, all the history get deleted , and i am unable to track how it is happening.
0 Likes 0 ·
Wilfred van Dijk avatar image Wilfred van Dijk commented ·
I assume you mean me (Wilfred) as a reply on my answer :)
0 Likes 0 ·
ThomasRushton avatar image
ThomasRushton answered
Job history is held in the sysjobhistory table in MSDB. Check the SQL Agent settings for how much job history it keeps - there are settings that may result in not seeing job history for some jobs, but plenty for others. It's not good - the settings are for maximum number of lines of history, and maximum number of lines of history per job. Sounds reasonable; however, if you have a job that runs every five minutes, and another that runs every month, you'll very rarely see any history for the latter.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jhunu avatar image jhunu commented ·
Thanks thomas for answer. I have checked the sysjobhistory and in that also only the current date executed is showing.SQL AGENT setting show me that it keeps 200000 rows for jobs and 5000 per jobs.For all the jobs i am unable to see the history.I am confused what is the thg that is doing this delete history job and i am unable to find out who is doing this delete (i mean sql ) .
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
There is also the possibility tha the job history is being purged by a maintenance plan SSIS task.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.