I have a job on the database which runs nightly at 1am using the DBMS scheduler.
I also want to be able to run the job manually whenever I was.
I do this by running
execute dbms_scheduler.run_job('JOB_NAME');
This all works fine and the job does run, however when i look up the job on DBA_SCHEDULER_JOBS the LAST_RUN_DATE column still only holds the date that the job was last run from the scheduler (at 1am) and not when i manually ran it. Does this make sense to anyone. I want to be able to get the last time the job was run so I can show the user running it.
This is the query where I'm looking up the LAST_RUN_DATE,
SELECT LAST_START_DATE
FROM DBA_SCHEDULER_JOBS
WHERE job_name='JOB_NAME';
My work around is to use this to get the last date but it doesn't seem right:
select log_date, job_name, status, run_duration
from dba_scheduler_job_run_details
where job_name='JOB_NAME'