Finding the 'n' oldest jobs in AM job history table

Document ID : KB000090094
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Finding the 'n' oldest jobs in AM job history table
Resolution:

Question

How to find the 'n' oldest jobs in the AM History table? i.e SO_JOB_HISTORY table.


Answer

The following SQL can be run against the AM database to find the 'n' oldest job in SO_JOB_HISTORY. For this example we have limited the results to the 10 oldest jobs.

select * from (select min(so_job_finished), so_module from so_job_history group by so_job_finished, so_module order by 1) a where rownum <= 10;

The '10' can be changed to get a different number of jobs.

This SQL is useful to confirm if the SYSTEM chain is deleting older records from the HISTORY table.