Solved

sysjobhistory does not old older records

Posted on 2010-11-18
10
1,009 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 69

Expert Comment

by:ScottPletcher
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 29

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
 
LVL 29

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 29

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 69

Expert Comment

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

Accepted Solution

by:
Rich Weissler earned 250 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 69

Assisted Solution

by:ScottPletcher
ScottPletcher earned 250 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now