Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sysjobhistory does not old older records

Posted on 2010-11-18
10
Medium Priority
?
1,079 Views
Last Modified: 2012-05-10
this is in sql 2000...

i basically want to see when was the last time a DTS package was run successfully which would be a year ago..

when i checked the above it has only 1000 entries.. is there a way i can look at the ones past the first 1000 records.. it is sorted by date desc..

thanks
0
Comment
Question by:anushahanna
  • 4
  • 3
  • 3
10 Comments
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 34167170
Yes, there's a default option that limits the job to 1000 entries.  You can change that to increase it to whatever you want.
0
 
LVL 30

Expert Comment

by:Rich Weissler
ID: 34167197
Check for the default limit under the properties of the SQL Server Agent Properties.
Unfortunately the ones that have already been truncated are gone.

JobHistoryLimit.JPG
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34167441
thanks for showing how to increase the limit..

now that i can't find through sysjobhistory, is there any other option to get a hint when it might have been run last?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 30

Expert Comment

by:Rich Weissler
ID: 34167702
If you don't care success/failure of the last run -- you can run:
select last_run_date from sysjobsteps where step_name='<jobname>'
It outputs as YYYYMMDD (their is a last_run_time field as well, if you need that.)
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34170885
Rzamus, it seems like the DTS package was never setup as a job.. so I do not see it in sysjobsteps... does SQL keep track when DTS packages are run manually..?
0
 
LVL 30

Expert Comment

by:Rich Weissler
ID: 34171332
I looked through all the DTS package tables yesterday, and didn't see anywhere where it tracked the run dates separately.  At best it has the various saved versions when the packages are modified/saved.
0
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 34173995
sysjobhistory stores job *and* step history, so all job history goes into that table.
0
 
LVL 30

Accepted Solution

by:
Rich Weissler earned 1000 total points
ID: 34174201
@ScottPletcher - Thanks.  The problem in this case, sysjobhistory was being truncated to 1000 lines, which is the default.  I mentioned sysjobsteps as a possible location of last resort to get a possible last run date, because it does seem to store that information there as well in some instances.  Given that the information anushahanna is looking for is not in sysjobsteps, and has already been truncated from sysjobhistory - are you aware of ANOTHER different location this information might reside?
0
 
LVL 70

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 1000 total points
ID: 34175332
No, there is no other standard location where past history is stored.

The only possibiity would be to recover the job history from the msdb tran log and/or tran log backups, assuming they were all available.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34191208
i gave a try with msdb TLB but too late.

at least now we have a better threshold (than 1000)

thanks very much for your help.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question