search cancel

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

book

Article ID: 90094

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM)

Issue/Introduction

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

Environment

Release: AAMOS499000-8.0-Automic Applications Manager-OS400 Agent
Component:

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.